src/libANGLE/capture/FrameCapture.h


Log

Author Commit Date CI Message
Shahbaz Youssefi 9f9284b7 2023-07-17T15:41:27 Move ShareGroup to its own files Bug: angleproject:8224 Change-Id: Id6d272018bb5ee8c3e35488f641efa4d99fa836d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4690003 Reviewed-by: Charlie Lao <cclao@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Igor Nazarov 36c3e0f5 2023-01-17T17:42:59 Implement "Shared Context Mutex" functionality. Existing implementation uses single `GlobalMutex` for - EGL calls - GL calls for Contexts with concurrent access. This CL introduces abstract `egl::ContextMutex` with two implementations: - SingleContextMutex; - SharedContextMutex<Mutex>; Note: `std::mutex` is used in this commit. It is very easy to change mutex type either at compile-time or at run-time (single type per Display). When Context: - is not Shared; - does not use `EGLImage`s; - does not use EGL_DISPLAY_TEXTURE_SHARE_GROUP_ANGLE - does not use EGL_DISPLAY_SEMAPHORE_SHARE_GROUP_ANGLE then it will be using `SingleContextMutex` with minimal overhead. Before such Context is used as `shareContext` or uses `EGLImage` its mutex replaced by `SharedContextMutex<Mutex>`. The `GlobalMutex` is only used for EGL calls, while `egl::ContextMutex` implementations for GL calls. Because some EGL calls use Context, explicit `egl::ContextMutex` lock is required. This is implemented by generating "egl_context_mutex_autogen.h" header, and insertion of `ANGLE_EGL_SCOPED_CONTEXT_LOCK()` macro before `ANGLE_EGL_VALIDATE()` in each EGL entry point. Implementation in "egl_context_lock_impl.h" returns lock for required APIs. Special cases of `egl::ContextMutex` lock handled separately. `std::unique_lock<>` is not used for performance reasons. `egl::ContextMutex` explicitly locked when capturing EGL calls. Fixes EGLImage problem: https://chromium.googlesource.com/angle/angle/+/e18240d136d15e5cdfa4fa4a6355ca21c8d807b6 Mark contexts as shared when importing EGL images. Details: - EGLImage inherits Context's mutex when created. Mutex is used when the EGLImage accessed or destroyed. - When EGLImage is used in Context with other `egl::ContextMutex`, two mutexes are merged into one. - After the mutex merge, Context Groups will remain separate, but will not be able to run in parallel. Fixes race when checking `context->isShared()` in the `SCOPED_SHARE_CONTEXT_LOCK()` macro. One Context may start executing GL call while not "Shared", but become "Shared" inside the call. New (second) "Shared" Context may immediately start using GL and potentially corrupt some "Shared" state. Possible performance benefit: allows parallel execution in some cases, when single `GlobalMutex` would block. Important note: Process of replacing the `SingleContextMutex` by `SharedContextMutex<Mutex>` is not 100% safe. This mean that original Context may still be using `SingleContextMutex` after activating `SharedContextMutex<Mutex>`. However, this was always the case before introduction of this CL. Old `Context::mShared` member update was not synchronized in any way at all. In other words, this solution does not 100% fix the original problem. For 100% safe solution `SingleContextMutex` should not be used (always pass `SharedContextMutex<Mutex>` to the `gl::Context` constructor). See `lockAndActivateSharedContextMutex()` for more details. CL adds new build option: angle_enable_shared_context_mutex = true Behavior with other build options: - When: `angle_enable_shared_context_mutex` is disabled or `angle_enable_share_context_lock` is disabled or `angle_force_context_check_every_call` is enabled, Contexts will always have `SingleContextMutex`, however it will be only used in special cases. `SCOPED_SHARE_CONTEXT_LOCK()` will use `GlobalMutex` when applicable. - Otherwise, `SCOPED_SHARE_CONTEXT_LOCK()` will use `egl::ContextMutex`. Some GFXBench "1080p Driver Overhead 2 Offscreen" performance numbers. Tested on S906B (Samsung Galaxy S22+) on old ANGLE base: https://chromium.googlesource.com/angle/angle/+/807c94ea85e046c6f279d081d99f0fb1bcf1191a Capture/Replay: Adjust tests do adhere to capture limits Each test result is an average frame number from 6 runs. SingleContextMutex 6579 ( +0.13%) (old) GetContextLock() (mShared is false) 6570 Forced `mShared = true` or NOT using `SingleContextMutex`. SharedContextMutex<std::mutex> FORCE 5061 (-22.97%) (old) GetContextLock() FORCE 4766 (-27.46%) Bug: angleproject:6957 Bug: chromium:1336126 Change-Id: Idcd919f9d4bf482b9ae489bd8b4415ec96048e32 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4374545 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Gert Wollny a8ba5112 2023-02-10T10:04:41 Capture/Replay: Deal with swap called in different contexts Move recording the context setup of the main context to the same location where all other context setups are recorded and drop the assertion that checks that swap is always called from the same context. Invoke the context setup at the time the secondary contexts are set up, and make sure the main context is correctly mapped. Bug: angleproject:7911 Change-Id: I327bce318b1a0e26ffdbf096343f99cedd78c116 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4236541 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Roman Lavrov a77e8e3a 2023-02-06T16:24:06 Limit logging when invalid calls are not captured. An app was crashing during capture due to a huge volume of such calls: % adb logcat -d | grep 'Not capturing invalid call' | wc -l 20609 There are a couple of cases where validation silently ignores "benign" invalid calls, such as glUniform*(-1, ...): https://crsrc.org/c/third_party/angle/src/libANGLE/validationES.cpp;drc=0c4306fc554c80506eb0f9b833a5d2a5fdd452d5;l=2815 Limit to (separately for active and inactive capture so that we still see these after triggering mid-execution capture). Example log after this CL: 02-07 11:54:45.869 7657 7749 I ANGLE : INFO: FrameCapture (capture inactive): Not capturing invalid call to glUniform1f 02-07 11:54:45.874 7657 7749 I ANGLE : INFO: FrameCapture (capture inactive): Not capturing invalid call to glUniform1f 02-07 11:54:45.882 7657 7749 I ANGLE : INFO: FrameCapture (capture inactive): Not capturing invalid call to glUniform1f (will no longer repeat for this entry point) ... (then I triggered capture) ... 02-07 11:55:13.049 7657 7749 I ANGLE : INFO: FrameCapture (capture active): Not capturing invalid call to glUniform1f 02-07 11:55:13.049 7657 7749 I ANGLE : INFO: FrameCapture (capture active): Not capturing invalid call to glUniform1f 02-07 11:55:13.050 7657 7749 I ANGLE : INFO: FrameCapture (capture active): Not capturing invalid call to glUniform1f (will no longer repeat for this entry point) Bug: b/267795212 Change-Id: I2f150cfa5b4c74fc1ebe5abeb1201cc4caad80e3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4224875 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Roman Lavrov <romanl@google.com>
Jamie Madill f7b5d5d1 2022-12-15T10:52:07 Capture/Replay: Remove inline variable declarations. This makes parsing easier for the "simplified C" interpreter. We introduce a resource ID buffer as a way to manage a list of resource IDs to replace the inline resource lists. Turns on the Among Us trace in the interpreter tests. Bug: angleproject:7775 Change-Id: I1bb9c0e9b087965a18691bc99b2e9947610b9eaf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4128719 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill fdada9ee 2022-12-13T14:52:53 Re-land: "Make SyncIDs a packed type." This re-land fixes the sync map size tracking. This prepares syncs to use a simple resource map like other types, which will make life easier in the trace interpreter. Bug: angleproject:7775 Change-Id: If2114c51d5b68503890eacbf549182823667fedc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4178012 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8971a592 2023-01-18T14:35:09 Revert "Make SyncIDs a packed type." This reverts commit 9de913077a5fcc3d2f2e327b56bbe30efe2fde96. Reason for revert: Fails win-trace, somewhat flakily. Original change's description: > Make SyncIDs a packed type. > > This prepares syncs to use a simple resource map like other > types, which will make life easier in the trace interpreter. > > Bug: angleproject:7775 > Change-Id: Ic2867f6133256f5ce2320eb2b322c1059266b201 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4103720 > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Cody Northrop <cnorthrop@google.com> Bug: angleproject:7775 Change-Id: I29534b14c973fa34a4cb7457d534cd6156f33cd2 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4178010 Auto-Submit: Jamie Madill <jmadill@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Jamie Madill 9de91307 2022-12-13T14:52:53 Make SyncIDs a packed type. This prepares syncs to use a simple resource map like other types, which will make life easier in the trace interpreter. Bug: angleproject:7775 Change-Id: Ic2867f6133256f5ce2320eb2b322c1059266b201 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4103720 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Cody Northrop 7fe33996 2022-12-02T00:04:28 Capture/Replay: Regen/Restore shaders and programs Add missing functionality that can recreate shaders and programs that are deleted during the run. Test: Plants vs. Zombies Heroes MEC Bug: angleproject:5968 Bug: angleproject:7848 Change-Id: I2d41ebe9df1e2ad1beef831acd72fd3f06f4eb1f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4060241 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cody Northrop 0790a807 2022-12-01T23:58:36 Capture/Replay: Add ResourcesToDelete For resources that are deleted but not recreated by the app, we need to skip the delete call we've been making for ResourcesToRegen. To support this, track which resources need to be deleted. We've gotten by without this for so long because most apps will immediately recreate a resource after deleting it. When they simply delete starting resources, we can't try to delete them again. Test: MEC of multiple apps Bug: angleproject:4599 Change-Id: I226ba7887e2b7b31d4ce9a75d6a8d0a24f3f32ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4075486 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Gert Wollny b432c84c 2022-12-01T10:40:03 Capture/Replay: Fix collecting the initialized contexts The main context initialization function will be emitted as "Shared" and not based on the context number, so only add the secondary contexts to the list of contexts that need additional setup. Fixes: b301b82235ca686d036a8d29380da22bb2060060 Capture/Replay: emit context setup for pre-MEC contexts only Bug: angleproject:7805 Change-Id: I4ac770a303ac93a448c9b46bf8c4cd58900ddd54 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4068124 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Gert Wollny b301b822 2022-11-07T09:37:14 Capture/Replay: emit context setup for pre-MEC contexts only When a context is made current for the first time it is added to the shared context set. If this happens after the mid execution capture has started, then the call to the context setup function is created, but the according function implementations was not emitted leading to compilation failure of the so created trace. Since a context that was never current doesn't actually have any setup that needs to be done when starting a MEC replay. Hence, there is no need to emit the calls fot SetupReplayContextXX. So track which context where actually in the shared context set when MEC started, and only emit the according calls to the setup functions. Bug: angleproject:7805 Change-Id: I83f8714733ead5c0d71560013c360b5671f0822a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4008199 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
Cody Northrop 11de5157 2022-11-14T14:48:33 Capture/Replay: Reset Shaders We've been resetting Programs correctly, but not Shaders. This hasn't been a blocker so far, but it has been identified as a performance problem for traces that compile mid-trace. We're not getting cache hits because the persistent blob cache is not updated until a shader is deleted. Part of the challenge here is ShadersIDs and ProgramIDs share a ResourceIDType, so separating them requires a bit more tracking. To fix, start tracking which ShaderProgramIDs are actually shaders and emit the correct glDelete* command. Test: diablo_immortal MEC Bug: angleproject:7823 Change-Id: I934f6eee243ab9681dca5fdebdad33ba31457cf5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4029226 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Lubosz Sarnecki e99e40c9 2022-10-11T12:27:18 FrameCapture: Implement shadow memory for coherent buffers. On certain devices like the Pixel 6 it is not possible to mprotect Vulkan allocated memory required for coherent buffer tracking. To overcome this limitation implement a shadow memory for coherent buffers when running FrameCapture that is exposed to the app and syncronized with the Vulkan memory and can be mprotected for coherent buffer tracking. Add a test to determine whether memory protection can be used directly or will require shadow memory. Run this test only on build configurations with assertions enabled. Determine the requirement of shadow memory through a deny list of device manufacturers and models, which is checked against ANGLE's SystemInfo. Add ANGLE_CAPTURE_FORCE_SHADOW environment setting and Android equivalent to force enable shadow memory. Test: angle_end2end_tests --gtest_filter="BufferStorageTestES3.*/ES3_Vulkan" Bug: angleproject:7402 Change-Id: I74b7930259d3bc1846ef96fffa782f8bc553b043 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3945018 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Gert Wollny 109604b8 2022-11-07T09:26:05 Capture/Replay: remove unused context param from scanSetupCalls Bug: angleproject:7805 Change-Id: I4e00876ad6174c15aaa9503cf9eeaa6ea041c2a6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4004416 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Yuxin Hu ce62d52f 2022-10-27T18:41:11 Fix Mid Execution Capture for External Texture How we capture eglCreateImage and eglCreateImageKHR have changed recently. Fix the code that recreate eglCreateImageKHR calls for external texture type in Mid Execution Capture. Bug: angleproject:7758 Change-Id: I2bd35ec3349f1d4f1aef1bf7f76ac50d4abca53d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3989645 Commit-Queue: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 06ecc918 2022-10-10T20:59:38 Capture/Replay: Optionally emit C sources. This adds an option that controls if we can write out simplified C replays. Once the work is finished we can remove the option and only allow emitting C instead of both C and CPP. Required emitting multi-line strings differently, as well as conditionalizing a few other language differences. Bug: angleproject:7713 Change-Id: I3303134316ed3fc1b4286bcd32961e8f7ecfbb06 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3953339 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 6193274a 2022-10-10T21:00:12 Capture/Replay: Redesign in-memory call capture replay. This will allow the replay to use the call captures returned by the interpreter's parser. Bug: angleproject:7752 Change-Id: If1b281d9ce7ccfbdc23bea615e1e2258c8a029f9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963367 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Jamie Madill 4bfb749f 2022-10-10T20:59:48 Capture/Replay: Move shared trace code into src/common. This will let them be accessible to the test harnesses. The trace tests interpreter will need direct access to the classes that we move in this CL. This CL also moves the GLenum utils into the common folder, where they were already used by some other tests. Bug: angleproject:7752 Change-Id: I97ad607938ef29bc316f6d40098478e002ea8128 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963362 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 8403e4c5 2022-10-10T20:59:29 EGL: Resource IDs for Surface, Context and EGL Image. This will make these classes play nicely with resource maps. As these objects are used in a lot of places, and simplified C can't handle unordered_map, it's necessary to index the maps by simple packed IDs in capture/replay code. This indirection will also have increased safety as we validate EGL resource ID handle values before accessing the memory directly. Also hides some of the other EGL capture methods behind helper methods to simplify the C code and hide assignments and other complex maps. Bug: angleproject:7758 Change-Id: Ibc7bb56430d3068bd38877c9dfb011979d4ea234 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3957164 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Jamie Madill bb420af7 2022-10-10T20:59:24 Capture/Replay: Rewrite map buffer calls. This wraps the map calls into simple helper functions that hide the return value assignment, which in turn will simplify C parsing. Allows us to remove storing the mapped buffer ID in the params. Bug: angleproject:7731 Change-Id: I756574cc0fa3d63cce4e0103b8f2861d093de186 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3953335 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Jamie Madill 2265e37b 2022-10-12T09:27:16 Capture/Replay: Auto-generate EGL capture code. Replaces the custom code in the EGL stubs. Skips a few "Get" entry points because this CL doesn't implement pointer capture like we do for all the GL entry points. Includes a new state in the AttributeMap that indicates which type of attribute values we used when initializing the map. Bug: angleproject:4035 Change-Id: I272eac5e4068602ce710ef66c9a1dce5387943a5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3949911 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 7c4dc253 2022-10-12T08:38:46 Capture/Replay: Clean up EGL capture. This switches the EGL capture types to ANGLE-casted pointers since that's what we receive in the capture layer. Note that even if the capture layer were used as a pure layer, not an EGL implementation, we'd still have these types for state tracking. This also prefixes each EGL class in the entry points with the egl namespace for consistency and for simplifying the ParamType code. Required changing to non-const gl::Context * in a few places. Also changes the gSurfaceMap to be indexed by the raw pointer value, which cleans up the code somewhat. Bug: angleproject:4035 Change-Id: Id800c1ba25e5819ac7ea1df8aab806bc393fe192 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3949910 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Yuxin Hu c22f091d 2022-09-29T18:58:33 Replace Hard-Coded egl image attribs This change is adapted from https://crrev.com/c/3838866 Added two hash maps to track below information: EGLImage* --> EGLint* attrib TextureID --> EGLImage* During the CaptureShareGroupMidExecutionSetup, when we iterate through all the textures the app created, if the texture is bound to External target, we will refer to the hash map TextureID --> EGLImage* to find the EGLImage* pointer, and then use the result as the key to refer to the other hash map EGLImage* --> EGLint* attrib to find the attributes used to create that EGLImage object. We can then use the attributes to populate eglCreateImage or eglCreateImageKHR calls in the trace calls. Bug: angleproject:7570 Change-Id: I729de4ddea59242ccbe6243e036451f290545185 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3928212 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Cody Northrop 5bafe449 2022-10-05T20:09:23 FrameCapture: Create default context reset calls Add support for emitting default reset calls for some entrypoints when recording a capture from the beginning. Test: Lineage 2 Revolution MEC Bug: angleproject:7741 Change-Id: I8e4e1184f3e3b68527a65283c459a43d135e95b4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3938442 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Cody Northrop 6dc30c00 2022-09-29T08:41:53 FrameCapture: Reset default uniform arrays If an application has updated a single uniform in the middle of an array, we need to emit the Reset call for the entire array. We don't track Reset calls per individual location in an array. Test: Life is Strange MEC Bug: angleproject:7711 Change-Id: Idec991ad060eb5e12272713a58aa921c5912f1cc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3928253 Reviewed-by: Roman Lavrov <romanl@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Jamie Madill 6ec89510 2022-08-31T11:10:45 Frame Capture: Remove MEC active variable. We only used this in one place, where we can instead use a check for frame capture being active generally. Bug: angleproject:7621 Change-Id: Ic004e3021750a6c43443eb8935b59514e8c06978 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3868931 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 64f41972 2022-08-25T11:16:23 Use canonical gl.xml and update enum to string function. This replaces our copy of gl.xml with the upstream canonical copy. Note that one patch is required before we can remove ANGLE's copy: https://github.com/KhronosGroup/OpenGL-Registry/pull/538 Because the upstream version uses a new method of enum groups, we also update our enum-to-string generator to use the new groups. This new code includes many more enums and groups in the mapping. Bug: angleproject:6461 Change-Id: I1c0ab44c36afce8db04c9661b377bbe5762c913e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3856649 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Cody Northrop fd89020c 2022-07-18T20:26:38 FrameCapture: Reset VertexArray state This change includes three things: - Tracking resources by context - Resetting VertexArray state - Splitting ResetReplay into per-context All three are needed to properly Reset Vertex Array objects. Vertex Arrays are considered container objects, which means they are not shared with other contexts. We've had a hole in Reset where we did not take multiple contexts into account. To address this, we now also track which contextID was used to modify a resource. For objects that need to know which context they are bound to, we track them in a map and return the correct index when getTrackedResource is called. To generate the calls to reset Vertex Array state, we are able to mirror what has been done for other ResourceTypeIDs. In order to properly Reset resources in multiple contexts, we have to bind the correct context before emitting the Reset calls. This has been done for Setup already, so we have a template to follow. With this CL, we now emit multiple functions to Reset state, similar to the following: void ResetReplayContextShared() { // Reset shared objects ... } void ResetReplayContext5() { // Bind the right context eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, context5); // Reset container objects for context5 ... } void ResetReplayContext6() { // Bind the right context eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, context6); // Reset container objects for context6 ... } void ResetReplay() { EGLContext context = eglGetCurrentContext(); ResetReplayContextShared(); ResetReplayContext5(); ResetReplayContext6(); eglMakeCurrent(EGL_NO_DISPLAY, EGL_NO_SURFACE, EGL_NO_SURFACE, context); } Test: Ni no Kuni MEC Bug: angleproject:4599 Bug: angleproject:7507 Change-Id: Ic585534f07172474aab0ce1d0396b0b064379f88 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3761874 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Lubosz Sarnecki <lubosz.sarnecki@collabora.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Gert Wollny fd9301c1 2022-06-17T12:25:10 Capture/Replay: Capture egl surface related calls Creation from a pbuffer and generalized destruction are implemented, as well as binding and releasing a TexImage and making the context current with explicit draw and read surfaces given. Bug: angleproject:4964 Bug: angleproject:6180 Bug: angleproject:6512 Change-Id: Id8be6486125d45341905f3aabdbae4366cd568b7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3711741 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Cody Northrop ce78f5f8 2022-05-10T09:10:30 Capture/Replay: Reset default uniforms Extend resource tracking to include default uniforms. They are tracked per location, per program. Setup for defaulft uniforms is unchanged, but Reset now includes a section like this: glUseProgram(gShaderProgramMap[6]); UpdateCurrentProgram(6); glUniform1uiv(gUniformLocations[gCurrentProgram][0], 1, reinterpret_cast<const GLuint *>(&gBinaryData[30518768])); glUniform1uiv(gUniformLocations[gCurrentProgram][1], 1, reinterpret_cast<const GLuint *>(&gBinaryData[30518784])); glUseProgram(gShaderProgramMap[9]); UpdateCurrentProgram(9); glUniform4fv(gUniformLocations[gCurrentProgram][1], 15, reinterpret_cast<const GLfloat *>(&gBinaryData[30518960])); glUniform4fv(gUniformLocations[gCurrentProgram][16], 3, reinterpret_cast<const GLfloat *>(&gBinaryData[30519200])); glUniformMatrix4fv(gUniformLocations[gCurrentProgram][20], 2, GL_FALSE, reinterpret_cast<const GLfloat *>(&gBinaryData[30519248])); ... Test: Animal Crossing MEC, Star Wars KOTOR MEC Bug: angleproject:7307 Bug: angleproject:7353 Change-Id: Ic344767f5dd4ffc38c15ed6bf81a7d1daf274a7b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3657474 Reviewed-by: Lubosz Sarnecki <lubosz.sarnecki@collabora.com> Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cody Northrop aac68adc 2022-05-21T22:27:22 Capture/Replay: Track dirty state per EntryPoint for Reset This CL introduces a new concept of tracking whether an entry point has been called. If so, emit Reset calls designed specifically for that entrypoint. This will likely only be useful for one dimensional state binding calls that can easily be tracked and set back. Only support for EntryPoint::GLUseProgram is added at the moment, but any entry point can be added. Reset will now set the active program back to what it was in Setup. For example: void ResetReplay() { ... glUseProgram(gShaderProgramMap[2]); UpdateCurrentProgram(2); } Test: Animal Crossing MEC, Star Wars KOTOR MEC Bug: angleproject:7307 Bug: angleproject:7353 Change-Id: I19d238ca13bbfb619e1cf8ed86f15ed6c4255a61 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3656827 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Gert Wollny bbf67e2e 2022-05-16T12:04:34 Capture/Replay: support capturing eglCreateImage/eglDestroyImage Because we support only a few functions the supporting code is not autogenerated. We don't capture the actual value of the display variable, because we assume that there is only one display, and the actual pointer to it is provided by the EGLWindow. The rest of the capturing works just like with the GLES calls. Bug: angleproject:4964 Bug: angleproject:5822 Bug: angleproject:6180 Bug: angleproject:6286 Bug: angleproject:6578 Bug: angleproject:7111 Change-Id: I385aa9648f93bf74706e9860e2aee5775eeba220 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3636062 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Lubosz Sarnecki f8ddca00 2022-03-03T15:34:15 FrameCapture: Use getCompressedTextImage. Replace retrieveCachedTextureLevel with getCompressedTexImage. Remove compressed texture shadow copy code. Treat GLCopyImageSubData calls as texture updates by handling them in trackTextureUpdate. Bug: angleproject:5592 Bug: angleproject:5604 Bug: angleproject:6104 Bug: angleproject:6177 Bug: b/181797364 Change-Id: Ic6b2a41ce536e3e4b66497048954efdafa556d1e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3516377 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Lubosz Sarnecki ed590dc8 2022-03-11T12:54:44 FrameCapture: Add override for Glsizei* types. Fix capturing glGetSynciv with null lengths on Linux. When calling the default WriteParamValueReplay handler with a nullptr, ostream on Linux will write `(nil)`. This fixes retracing all traces containing glGetSynciv calls with null lengths. Add a NullLength test to FenceSyncTests that used to fail in the capture_replay_tests. Test: capture_replay_tests.py --gtest_filter=FenceSyncTest.NullLength/* Bug: angleproject:7071 Bug: angleproject:6808 Change-Id: I0a2bd4db744ce2a026cd932ba0f2f4747672fcc8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3526653 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Cody Northrop 7b202392 2022-03-02T17:32:45 Capture/Replay: Fix capture on Linux Need to add support for printing "const GLint *" types. We've been falling into the default handler and getting lucky with how other platforms handle ostream with a null value. We use this extensively with glShaderSource(). Test: MEC of an existing trace on Linux Bug: angleproject:7071 Change-Id: I7e4f1fbf2876dddac49ea6583918dbc534070d75 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3501201 Reviewed-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Cody Northrop c80c7ae3 2022-02-24T10:43:15 Capture/Replay: Merge Deletes in Reset Before this CL, when regenning resources, we would iterate through each resource ID and issue a delete followed by a gen. The delete is required to get resources back to their original state, often caused by applications recreating them during the run. This ran into problems when our resource maps had stale data in them, i.e. a texture that had been deleted by the app but remained in our gTextureMap. We could inadvertently delete a resource we had just genned. For example, in ResetReplay(), say we have two textures to delete: // gTextureMap[1] start with 5 const GLuint glDeleteTextures_texturesPacked_1[] = { gTextureMap[1] }; glDeleteTextures(1, glDeleteTextures_texturesPacked_1); // We just deleted texture 5, now create a new one glGenTextures(1, reinterpret_cast<GLuint *>(gReadBuffer)); // The driver returned 15, which was unused at this time UpdateTextureID(1, 0); // gTextureMap[1] now contains 15 ... // gTextureMap[2] happens to start with 15, which was in use in // the trace, but was deleted and is no longer in use. The // deleted value is not cleared from gTextureMap (which is // another possible way to solve this). const GLuint glDeleteTextures_texturesPacked_2[] = { gTextureMap[2] }; glDeleteTextures(1, glDeleteTextures_texturesPacked_2); // Whoops! We just deleted our brand new texture 15, even though // it no longer maps to the original texture. glGenTextures(1, reinterpret_cast<GLuint *>(gReadBuffer)); UpdateTextureID(2, 0); // Now gTextureMap[2] contains whatever came back from the driver ... // The first use of gTextureMap[1] will fail on loop because // texture 15 no longer exists! To avoid this problem we delete all resources up front before genning any new ones. const GLuint deleteTextures[] = {gTextureMap[1], gTextureMap[2]}; glDeleteTextures(2, deleteTextures); // Now we no longer have any deletes in the create sequence glGenTextures(1, reinterpret_cast<GLuint *>(gReadBuffer)); UpdateTextureID(1, 0); glGenTextures(1, reinterpret_cast<GLuint *>(gReadBuffer)); UpdateTextureID(2, 0); This is applied to all the resources we regen right now. This CL: * Merges the deletion of new resources (that didn't exist when the trace starts) with resources that are being regenned. That means there is just one big delete. * Removes Delete from the call sequences we track for each resource since we no longer need to keep them around. * Adds a formatting helper to avoid code duplication. Test: Blade&Soul Revolution MEC (UE4) Bug: angleproject:4599 Bug: angleproject:7053 Change-Id: Ida3b7e1ad5d94c5e9860447d5cf959278f37ad47 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3492849 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Gert Wollny <gert.wollny@collabora.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Lubosz Sarnecki 287057b3 2022-01-25T17:01:43 FrameCapture: Don't track coherent buffers before capture starts. Even though coherent buffer storages were only captured after capture was activated, the buffer tracker was incorrectly initialized with the first call to glMapBufferRange, even though capture was not active. This fixes corrupted rendering in War Planet Online due to all coherent buffer storages being tracked at initialization of the app, when FrameCapture was enabled but not active. Introduce mMidExecutionCaptureActive, which exposes if MEC is currently executed. Bug: angleproject:5857 Bug: angleproject:6774 Change-Id: I4849d6497e8e08aefc60e68bae027915e9b2912f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3416227 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Lubosz Sarnecki c984dad5 2021-12-03T16:02:49 FrameCapture: Don't remove protection from shared pages. Don't remove protection from pages that are shared when a persistent coherent buffer storage is unmapped. The shared page can still be relevant when the the other buffer is kept and written to. Add a PageSharingBuffers test that produces this behaviour. Test: angle_end2end_tests --gtest_filter="BufferStorageTestES3.PageSharingBuffers/*" Bug: angleproject:5857 Change-Id: I6927f25229d2dfe9f68ba9a993e9d3e994bc7ce0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3306623 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Lubosz Sarnecki d4b8cd5e 2021-09-14T16:34:31 FrameCapture: Implement capture of coherent bufferstorages. Track buffers with the GL_MAP_COHERENT_BIT_EXT access flag in a CoherentBufferTracker on a per page basis using the PageFaultHandler and protection functions from system_utils. Check for dirty memory and capture it on draw calls. Bug: angleproject:5857 Change-Id: Ib098f96952db7583d3e6517570c179e7754f54b2 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3168629 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Jamie Madill f60b152c 2021-12-06T10:19:53 Frame Capture: Merge small frames into single sources. By buffering up the replay functions before writing them out into sources, we can reduce the number of replay files by a large margin. Bug: angleproject:5133 Change-Id: I0a556fd1a3a5f2dcc8a26b761e885c9b7e464cf5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3316200 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e8b186c9 2021-12-09T09:45:20 Frame Capture: Don't unmap regenned buffers in reset. These buffers are deleted and recreated, so unmapping them gives a "resource not mapped" error during replay. Found when working on the "world_war_doh" trace. Bug: angleproject:5133 Change-Id: Id1e6318c44a2a09fa643ef0a72f1d03d8396e5fb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3327862 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill d02d6a40 2021-12-06T09:26:14 Frame Capture: Track written files in ReplayWriter. This means we don't need to recreate the list of written files in the JSON where we list the trace files. It will allow for more flexibility when we change what trace files we output. Bug: angleproject:5133 Change-Id: I651b6a281c50040d32361a5a020ba3eaa4241bf0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3316199 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 0f09d378 2021-12-07T13:32:39 Frame Capture: Track return value in max resource IDs. This adds handling for return value processing when it comes to maximum resource IDs. Specifically for glCreateShader and glCreateProgram. Fixes MEC with re-capture with the blockman_go and probably other traces that call CreateShader as the final operations during setup. Bug: angleproject:5133 Change-Id: I799dfec776ca8c80a0b89c7f0c7c23423ef3896a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3320887 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8313ffe2 2021-11-29T15:46:25 FrameCapture: Add ReplayWriter helper class. This centralizes all of the replay file I/O into a single point. Each function is stored separately in this class. Right now there's some small file format changes: - the namespaces for the capture label are gone. these had no functional impact now that each trace was a separate module. - the header is cleaned up into private and public functions. this cleans up a few things like defining non-existent functions. - inline variables are tracked through the replay. they are now global instead of anonymous, and string sets get reused instead of duplicated between frames. There should be no functional changes with the naming of the trace files or the trace behaviour. This change sets the stage for the ReplayWriter buffering multiple frames into a single cpp file on disk, which can potentially reduce the number of object files in the compilation by a great deal. It could also be extended to work with buffered I/O so we don't block and hitch when we're writing large trace files. Bug: angleproject:5133 Change-Id: Ib96685e1202ac8101a4b828fa79642236af2120a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3311940 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Gert Wollny 3b6f80b7 2021-11-23T10:07:43 Capture/Replay: eliminate redundant parameters in GenOnBind The template parameter already defines the parameter value name and the parameter value type, so add some traits to simplify the call interface of the function. Bug: angleproject:6425 Change-Id: I037bed8e5cc2e7367d8faa3af5d4fba2bfbb52c3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3295617 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Gert Wollny 1d555687 2021-11-09T11:16:24 Capture/Replay: Set FBO ID when generated on bind GLES allows FBO ID's to be reserved on bind, so if a FBO is bound with and ID that was not yet reserved by a glGenFramebuffers call, update the resource tracking and the resource map to account for this resources that was created on bind. Bug: angleproject:6425 Change-Id: I343fc17bfbbfd9c8c47d6fe207a4f3817acb835d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3190970 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Gert Wollny bb5dbd49 2021-10-05T11:57:44 Capture/Replay: Handle TvoidPointer in specialization Bug: angleproject:6521 Change-Id: I863ad5307498e6394f5fbe3e650ce29c821083b1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3204960 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill 043120ee 2021-09-29T15:56:46 Capture/Replay: Allow disabling program trimming. The ANGLE_CAPTURE_TRIM_ENABLED variable disables program trimming when set to 0. This is useful for trace validation, which expects the GL state vectors to be identical. Bug: angleproject:5133 Change-Id: I3ab41de80af7b223c4cb8a1b7e14f049717305fc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3193417 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Cody Northrop 3719c172 2021-09-20T17:33:14 FrameCapture: Filter program setup calls This CL adds filtering to shared setup calls based on whether a resource is used during the frame capture. Calls that are filtered out will not be written to SetupReplayContextShared. This eliminates setup for unused resources. This has become critical for apps like Fortnite that compile tens of thousands of programs before running any frames. This can take multiple minutes to perform before rendering a frame. To achieve this, we do the following: - Add an active status to every call (default to TRUE). - Mark setup calls for tracked resources to FALSE during MEC. - During the run, track for any use of the resource, and mark its setup calls back to TRUE. - Enable tracking for ShaderPrograms. Test: Fortnite MEC Bug: b/180418810 Bug: angleproject:5658 Change-Id: I5070297d339de3b80f870640e8955077a2bc20aa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3150387 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
YuxinHu a09dca68 2021-09-20T23:40:28 Fix app trace heap buffer overflow During runMidExecutionCapture(), we need to update mMaxAccessedResourceIDs[idType] for idType==ShaderProgram, so that we have enought slot in gShaderProgramMap2 to store the temp shader we create in GenerateLinkedProgram(). Changes in this CL: 1.Renaming Jamie's mMaxAccessResourceIDS array update function updatePreCallResourceCounts() to updateResourceCounts(). 2. Adding updateResourceCounts() to Cody's setup call post processing function scanSetupCalls(). In GenerateLinkedProgram(), we add the temp shader create call with its' tempShaderID into the shareGroupSetupCalls. After that we will run the function scanSetupCalls(), where we will be able to loop through the tempShaderID and update the mMaxAccessResourceIDS[ShaderProgram] with the correct count. Bug: angleproject:6398 Change-Id: Iee78b3b7c1908a90ee8456476902f5e52e4615dc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3172005 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Cody Northrop 0babcb08 2021-09-14T10:49:06 FrameCapture: Scan Setup instructions The ability to add calls from a multitude of locations rather than a centralized spot has become a useful feature. But some locations were updating the max read buffer size via updateReadBufferSize, while others weren't. Rather than force everything to call a central spot for tracking, add post process scanning of Setup calls to handle updates. This is already done for frame calls in maybeCapturePreCallUpdates. Test: Fortnite MEC Bug: b/180418810 Bug: angleproject:5658 Change-Id: I51d3a39ea40073d2dca50339ef4b38712b81f4ca Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3160500 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Jamie Madill c12d2f37 2021-09-09T12:11:14 Capture/Replay: Remove unused function in header. Bug: angleproject:5133 Change-Id: I80f22d95101263f2ff37835c9e0f634b96d41622 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3150258 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill c5a38976 2021-09-01T07:35:40 Capture/Replay: Add expression trigger validation calls. Setting the environment variable "ANGLE_CAPTURE_VALIDATION_EXPR" will make ANGLE's capture logic evaluate this expression every captured call to see if it should insert a validation checkpoint. The retracing script also accepts --validation-expr as an argument. For instance, the expression: ((frame == 2) && (call < 1189) && (call > 1100) && ((call % 5) == 0)) Will insert validation checkpoints on frame 2, between calls 1100 and 1189 and will validate every 5th call. The 'call' here is the count of captured calls, which are mostly GL calls with a few ANGLE replay calls in the mix. We add a small single-header library that can evaluate arthithmetic expressions in order to parse these expressions, as well as an option to the retracing script. Bug: angleproject:5133 Change-Id: Ic369e85d8e905a3a7a32fa098f7d8ebe7baf4ab9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3136094 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Gert Wollny 349d555d 2021-09-02T10:07:26 Capture/Replay: handle glGetBooleani_v This also fixes a test. Bug: angleproject:6180 Change-Id: Icad2d089738f4458c90b87620337e9798adb9141 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3139898 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
Jamie Madill ec8418da 2021-07-02T09:55:39 Capture/Replay: Use plain arrays for resource maps. Instead of using the templated wrapper class, use C++ arrays that are dynamically allocated with "new". This saves a fair bit of binary size spent in calling the operator[] function. To get the right size this CL adds tracking to the capture for each resource type, then updates trace initialization to store the maximum allocated resource ID for each type. Tested with Manhattan 3.0: on Windows with Release, binary size for the trace shared object went from 7.053 MB to 6.125 MB. About a 13% decrease in binary size. That will allow for longer captures and will also reduce trace overhead. Bug: angleproject:5133 Change-Id: I2cd7515262a9ec76112d5f790001e3a6e9acd3a9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3003383 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 9c05f55a 2021-07-15T10:58:10 Capture/Replay: Add replay state validation. We can use this to validate traces that have slight differences when retracing. The valdation works by embedding the "expected" JSON into a string at the end of each captured frame. The replay also embeds a callback which fires right before the swap in the replay harness. The harness then gets the "actual" JSON and runs a comparison. On a mismatch it calls "diff" externally. Currently the diff call is hard-coded to work on Linux only. Note that when running validation it's important to replay on SwiftShader since that's what we use to retrace. Bug: angleproject:5133 Change-Id: Icbf0031d07be8bd916607c537dec235f9a512c43 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3066008 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Tim Van Patten 58bb11ca 2021-04-16T12:28:50 Capture/Replay: Multi-Context Support Add support for capturing and replaying multiple contexts. 1.) Create and initialize the Contexts in the share group during SetupReplay(). 2.) Track the Context the command stream is for, and if the Context ID changes, inject an eglMakeCurrent() call to switch to the new Context. 3.) Intercept eglCreateContext() and eglMakeCurrent() to route to either EGLWindow or WGLWindow, depending on the current platform. Specifically, this enables capturing and replaying Asphalt 9. Bug: angleproject:5878 Change-Id: I5bc9b7ece5388ce405ba3f9e9dc3967e78662000 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2830145 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Cody Northrop 5f092f8b 2021-08-17T17:15:59 FrameCapture: Support glProgramBinary This CL allows applications to use glProgramBinary. Normally this is a problem because we need program source in order to recreate shaders in use during mid-execution capture. Use of program binaries means an app can start and render frames without having submitted source for that run. To support this, we will embed program source into ANGLE's binary format. This will allow us to extract it when the app submits the binary. We will only embed this when capture is enabled to prevent increased binary size in the common case. Since this changes ANGLE's binary format, apps will recreate binaries when capture is enabled. Additionally, we can't allow captures to have glProgramBinary calls in the middle of captured frame ranges, so intercept those calls and replace with a full linking sequence. Changes include: - Add new frontend feauture enableProgramBinaryForCapture that allows OES_get_program_binary during capture. - Update ANGLE's binary format to include program source when capture is enabled. - Update maybeOverrideEntryPoint to handle multiple new calls instead of a single call. - Override calls to glProgramBinary that occur mid-capture to instead emit a full GenerateLinkedProgram sequence. - Add checks for created/attached shaders during FrameCapture since they won't be available for programs populated by the app using glProgramBinary. Test: Fortnite MEC Bug: b/180418810 Bug: angleproject:5658 Change-Id: Ib2a0e9e434d3ee0f384d128c48b2a7d4834f5b0f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3105390 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 839d5318 2021-08-16T08:29:28 Capture/Replay: Changes to MEC first frame capture. Recent changes made it so it was impossible to trigger MEC *after* the first frame and *before* the second frame. Instead it was only possible to capture *before* the first frame or *after* the second frame. Makes it possible for the retracing script to do identical captures. Also includes a number of refactorings to make it simpler to follow the code, including renaming methods, and removing some extra output files. Bug: angleproject:5133 Change-Id: Ice6a189eb9f4d53e8ee1ba39beb537af2ef5fd9f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3097807 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Jamie Madill ad286e71 2021-08-17T10:43:47 Capture/Replay: Clean up ResourceTracker access. This reduces the boilerplate needed to tracked genned/deleted resources. Refactoring change only. Bug: angleproject:5133 Change-Id: I81f8877b2c308fe9d4136999f3ca63371a070720 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3100591 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Tim Van Patten 62cac8b5 2021-08-06T18:24:52 Capture/Replay: Add EGL support to generate_entry_points.py Add EGL support to generate_entry_points.py. This is a pre-requisite to frame capture being able to generate EGL calls, which is required for multi-context support. Bug: angleproject:5878 Bug: angleproject:4035 Change-Id: I3b8e9c91f9e2820b5207fc02d858e8109921f581 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3078993 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tim Van Patten 3fd572c4 2021-08-04T12:45:09 FrameCapture: Fix setCaptureActive() and MEC timing Frame capture is currently off by one when calling setCaptureActive() and collecting the mid-execution capture state. The MEC state is collected at frame N, but setCaptureActive() isn't called until frame N+1, meaning all of the maybeCapturePreCallUpdates() and maybeCapturePostCallUpdates() calls are not tracking resources correctly for frame N. This CL fixes when setCaptureActive() is called relative to when setupSharedAndAuxReplay() is called, so the trace is active for the first frame and all of the resources are correctly tracked. Additionally, setCaptureActive() during the FrameCaptureShared() ctor if frame capture starts with the first frame. Bug: angleproject:6225 Change-Id: Id07e78b2da9c9d33779e20ab6a42f63cd103a6a6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3071940 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Jamie Madill 35bdaf8d 2021-08-03T08:12:26 Capture/Replay: Minor cleanups. Removes a duplicate assignment to the enabled variable. In the cpp it's set to true, and in the header it was false. Also updates a few variable names to be consistent with the group. Bug: angleproject:5133 Change-Id: I3fb00ecc474191bea7c3a650ce23805b6f02d667 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3066007 Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Lubosz Sarnecki 262dc97c 2021-07-27T11:13:59 FrameCapture: Capture the EGL color space. Add a SurfaceParams struct containing extents and color space so a single map can be used for all draw surface parameters. Persist the color space in the trace's header. Bug: angleproject:5857 Change-Id: I327da8c8870f2d76d057954af57d977a10ebb59f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3056371 Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cody Northrop b5630d5c 2021-07-19T20:39:02 Capture/Replay: Add textures to resource tracking This CL: - Shifts resource reset tracking to be stored in an array of structs indexed by type. This helps curb the complexity of adding more resource types. - Moves buffer and program tracking to the new layout. - Adds textures to the resource tracker, using new layout. Note that only aspects common to all ResourceIDTypes have been moved to the new layout. Unique pieces of data, like buffer mapping state and GLSync handling, remain in resource tracker alone. Since texture setup is quite involved, this CL takes the approach of having each call applied to two call chains at the same time; SetupReplay calls and ResetReplay calls. ResetReplay ends up with a sequence similar to buffers: ... const GLuint deleteTextures[] = { gTextureMap[1], gTextureMap[2], ... gTextureMap[n]}; glDeleteTextures(<count>, deleteTextures); ... glGenTextures(1, reinterpret_cast<GLuint *>(gReadBuffer)); UpdateTextureID(1, 0); glGenTextures(1, reinterpret_cast<GLuint *>(gReadBuffer)); UpdateTextureID(2, 0); glGenTextures(1, reinterpret_cast<GLuint *>(gReadBuffer)); UpdateTextureID(3, 0); ... glBindTexture(GL_TEXTURE_2D, gTextureMap[1]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, 9729); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, 33071); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, 33071); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, 33071); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, 519); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0); glTexImage2D(GL_TEXTURE_2D, 0, 6406, 512, 512, 0, GL_ALPHA, GL_UNSIGNED_BYTE, reinterpret_cast<const GLubyte *>(&gBinaryData[183263280])); glBindTexture(GL_TEXTURE_2D, gTextureMap[2]); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, 9987); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC, 519); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 6); glTexStorage2D(GL_TEXTURE_2D, 7, GL_COMPRESSED_SRGB8_ETC2, 64, 64); ... Test: PUBG Mobile MEC Bug: b/180418573 Bug: angleproject:6087 Change-Id: I9f8e151c12aec5b2b7af376b8e0ff644ff9c61c4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3016114 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Gert Wollny 1e75181f 2021-07-15T13:39:08 Capture/Replay: redesign capturing of arrays passed by pointer Instead of doing a lookup of the number of passes array when the call is written, store the number of array values in the ParamCapture when the call is captured. Bug: angleproject:6164 Change-Id: I87b0e2f776a6884b999cc50844e0777cda26b380 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3031543 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
Tim Van Patten 223cd0ac 2021-06-15T18:46:07 Capture/Replay: Refactor shared context handling This is the initial CL to enable capture/replay of multi-context applications. This CL refactors FrameCapture and FrameCaptureShared to move much of the functionality into FrameCaptureShared, since most everything is shared by Contexts in the share group. For example, the setup of the majority of the GL objects is done in the new SetupReplayContextShared() function in the new $LABEL_capture_context_shared_frame001.cpp file. The setup is performed by (for example): void SetupReplay() { $LABEL::InitReplay(); $LABEL::SetupReplayContextShared(); SetupReplayContext2(); } This performs the shared setup first, followed by the context-specific setup, which may reference shared objects careated by LABEL::SetupReplayContextShared(). No re-capturing is required with this change, since the external APIs (i.e., SetupReplay()) are still the same. Bug: angleproject:5878 Test: Manual MEC and replay of Magic Tiles 3, Candy Crush Soda Saga, Temple Run 2 Change-Id: Iab7bfe651437e9be1dee83514cd97acc20c61d1d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2965780 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Gert Wollny 5fb5f63b 2021-06-29T09:56:43 Capture: Write captured context for empty frames When a frame is empty, still write the captured context for that frame because the index file will contain the frame file, and the replay will execute the according swapbuffer so that the replay will query the context serialization when testing trace correctness. With that enable RobustResourceInitTest.SurfaceInitializedAfterSwap/* for capture/replay. Bug: angleproject:5939 Change-Id: Ib280d55f739cc2bb8d2da0919e98c37a2cd576ba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2987991 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cody Northrop aec47ff6 2021-06-22T15:47:43 Capture/Replay: Update CopyImageSubData params The parameters to glCopyImageSubData are flexible and can take a TextureID or a RenderbufferID as a GLuint. Our replay needs to remap those values, so we'll convert the GLuint based on the target. This leads to a change like the following. Before: glCopyImageSubData(138, 0x0DE1, 0, 0, 0, 0, 642, 0x0DE1, 1, 0, 0, 0, 256, 256, 1); After: glCopyImageSubData(gTextureMap[138], 0x0DE1, 0, 0, 0, 0, gTextureMap[642], 0x0DE1, 1, 0, 0, 0, 256, 256, 1); Test: PUBG Mobile MEC Bug: angleproject:6087 Bug: angleproject:6104 Change-Id: I5cd422e41ffbb4f08c8909e520bdce63e3008c5a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2981464 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Gert Wollny c8677c73 2021-06-12T17:23:42 Capture: Add a specialization for const GLuint * Bug: angleproject:6058 Change-Id: I31cad1dd23d313aae625874e140c406747e0f4c4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2957953 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Gert Wollny 78437770 2021-06-12T15:48:26 Capture: read four values for GL_TEXTURE_CROP_RECT_OES This texture parameter describes a cropping region x,y, width, height. Bug: angleproject:6057 Change-Id: I2c71f6aec1e536f42e06c19cb025889094b57a35 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2956510 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Gert Wollny 22716d31 2021-06-11T13:51:41 Capture: Add specialization for ParamType::TGLubyte Also enable "CurrentColorTest.Set/*" tests. Bug: angleproject:6049 Change-Id: I65e62b6c0805687ad6744a12217e0c08bc97ca1a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2954262 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Gert Wollny 90f9ddd9 2021-06-10T14:35:13 Capture: Add support for capturing (Get)ClipPlanef equation In addition, correctly handle "const GLfloat *" when replaying, and enable the according capture/replay tests Bug: angleproject:6047 Change-Id: I5dd7510d1b621d4c941490c9d0261559a96dd681 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2951133 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Gert Wollny cb4f8a79 2021-06-08T10:39:47 Capture: Add a specialization for TGLeglImageOES When writing out the parameter TGLeglImageOES an additional cast is needed. Bug: angleproject:6036 Change-Id: I7470a58a6ae17b0185d0c2e3fe1184b698f3efaf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2944952 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
Gert Wollny 421c665c 2021-05-13T21:17:16 Capture: Make writeCppReplayIndexFiles a method of FrameCapture This is useful to not pass a large amount of parameters around. Bug: angleproject:5965 Change-Id: I3890a0ca852729bbf74725fb9e5f4062e20e9158 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2894485 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Cody Northrop 8ea11eb7 2021-05-13T15:54:41 Capture/Replay: Reset programs on loop Apps that create new programs during the run need to have them deleted on loop. This CL handles that. It does not handle programs that have been deleted and need to be recreated, or that have been modified otherwise. An assert has been included to catch that for future needs. With this CL, entries like this will show up in ResetReplay: ... glDeleteProgram(gShaderProgramMap[120]); glDeleteProgram(gShaderProgramMap[121]); ... Test: Pokemon Go MEC Bug: b/188091629 Bug: angleproject:5968 Change-Id: I78c425e8fe95792fc626484641d067613dfae971 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2895326 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tim Van Patten 7444466c 2021-04-19T18:44:13 Reland "Capture/Replay: Reset GL Fence Sync objects" This is a reland of 9b4fd5456e3cc8c5412af96212d2840b422208b5 This fixes the original CL by moving where setCaptureActive() is called to allow the first replay source file to be written. Original change's description: > Capture/Replay: Reset GL Fence Sync objects > > Asphalt 9 uses GL Fence Sync objects during rendering, which results in > Fence Sync objects being created during setup and deleted while > replaying frames. When the replay is restarted, the Fence Sync objects > that were created during setup and deleted during the replay need to be > recreated during the reset phase. > > Bug: angleproject:5883 > Bug: angleproject:4599 > Change-Id: I118f2b7208c4d512ab646b10f52b3a0936895089 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2838237 > Commit-Queue: Tim Van Patten <timvp@google.com> > Reviewed-by: Cody Northrop <cnorthrop@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> Bug: angleproject:5883 Bug: angleproject:4599 Bug: angleproject:5900 Change-Id: I5e1d901d8875007691699b7b973f3fb7db027337 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2850758 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Jamie Madill 3839fa5b 2021-04-26T13:08:15 Revert "Capture/Replay: Reset GL Fence Sync objects" This reverts commit 9b4fd5456e3cc8c5412af96212d2840b422208b5. Reason for revert: Breaks capture: INFO:root:Passed: 0, Comparison Failed: 0, Crashed: 0, CompileFailed 0, Skipped: 745, Timeout: 0 Bug: angleproject:5900 Original change's description: > Capture/Replay: Reset GL Fence Sync objects > > Asphalt 9 uses GL Fence Sync objects during rendering, which results in > Fence Sync objects being created during setup and deleted while > replaying frames. When the replay is restarted, the Fence Sync objects > that were created during setup and deleted during the replay need to be > recreated during the reset phase. > > Bug: angleproject:5883 > Bug: angleproject:4599 > Change-Id: I118f2b7208c4d512ab646b10f52b3a0936895089 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2838237 > Commit-Queue: Tim Van Patten <timvp@google.com> > Reviewed-by: Cody Northrop <cnorthrop@google.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> Bug: angleproject:5883 Bug: angleproject:4599 Change-Id: I56c682e1d90dcdde7b18c941aad976825de3af42 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2851057 Reviewed-by: Jamie Madill <jmadill@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Tim Van Patten 9b4fd545 2021-04-19T18:44:13 Capture/Replay: Reset GL Fence Sync objects Asphalt 9 uses GL Fence Sync objects during rendering, which results in Fence Sync objects being created during setup and deleted while replaying frames. When the replay is restarted, the Fence Sync objects that were created during setup and deleted during the replay need to be recreated during the reset phase. Bug: angleproject:5883 Bug: angleproject:4599 Change-Id: I118f2b7208c4d512ab646b10f52b3a0936895089 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2838237 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Tim Van Patten fbfecbe2 2021-04-07T11:26:13 Capture/Replay: Add PPO/glProgramUniform support Command and Conquer: Rivals requires additional frame capture API support: - Program Pipeline Objects - glProgramUniform* Bug: angleproject:5830 Change-Id: I159086f92d2dfead0a513cd17fadeda7df92f408 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2809891 Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Lubosz Sarnecki fddbc9c7 2021-03-04T20:45:01 capture: Implement capturing GLES1 vertex pointers. Implement capturing glVertexPointer, glTexCoordPointer, glNormalPointer, glColorPointer and glPointSizePointerOES using a new CaptureVertexPointerGLES1 helper function. This is done by using fixed indices for gClientArrays that are retrieved from the GLES1Renderer. Bug: angleproject:5751 Change-Id: I6c774ff21942ea3422c4c77a615f88299901c0ab Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2773288 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Cody Northrop a70a6a9d 2021-03-09T10:38:13 Capture/Replay: Fix compressed cube textures We were only tracking one image per level of cube map textures. Instead, we need to track one per face (6). Test: MEC for Extreme Car Driving Simulator Bug: b/180419767 Bug: angleproject:5735 Change-Id: I59e6a5e83a60666a29f44d0a1e1993a1b461e8e7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2744293 Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Jamie Madill 6fc10389 2021-02-10T11:20:16 Move Frame Capture to capture/ folder. This will make it easier to trigger the trace tests when these files are modified. Bug: angleproject:5530 Change-Id: I5f0c450595b380cd91b20c1477dc1845bee35dd9 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2686120 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>