src/libANGLE/capture/FrameCapture.cpp


Log

Author Commit Date CI Message
Mark Lobodzinski c687078a 2023-05-01T16:45:19 FrameCapture: Add GLES1 case for BlendFunc state init/reset A recent frame capture change added state init/reset for glBlendFunc/glBlendFuncSeparate calls and combined them to avoid complexity, but this caused crashes in GLES1 native trace playback. This CL separates handling of the two calls. Test: angle_trace_tests --gtest_filter=TraceTest.street_fighter_iv_ce Bug: b/280329971 Change-Id: I34d674e2fc051f5af70a60a24e5b65c5ce54fd49 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4494261 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Roman Lavrov <romanl@google.com> Commit-Queue: Mark Łobodziński <mark@lunarg.com>
Justin Novosad fbff065c 2023-05-03T22:19:07 Replace GetResourceFromHashSet with map lookup Function GetResourceFromHashSet had linear time complexity because it was sweeping through the set until a resource with a matching ID was found. This change replaces hash sets with hash maps to get constant time lookup. This solves, among other things, O(N^2) time complexity for rendering scenes containing a large number of surfaces. Function GetResourceFromHashSet was consuming over 50% of all CPU time on the main thread of Chrome's GPU process while running the MotionMark 1.2 Images test. With this change, the benchmark score increases by 70% on an M1 MacBook running a PGO official build of Chrome. Bug: chromium:1435066 Change-Id: I895ac0141a91d324c63adec2c0efb8e030d9675b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4505950 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Justin Novosad <junov@chromium.org> Reviewed-by: Igor Nazarov <i.nazarov@samsung.com>
Alexey Knyazev 73f9cf00 2023-03-31T00:00:00 GL: Implement polygon mode extensions * Implemented polygon mode extensions on the OpenGL backend * Supported capture and serialization of the new commands and state * Added PolygonModeTest end2end tests Bug: angleproject:1791 Bug: angleproject:8132 Change-Id: I3bc08546a02f110dd739950129bee25ccc507bf6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4492683 Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi cd6a58f2 2023-04-18T12:45:10 Vulkan: Make eglPrepareSwapBuffersANGLE less special This function now uses the UnlockedTailCall mechanism so it doesn't require as much special-case code generation. This change does not fix the bug that this function is doing too much work without holding any locks. That will be done in a follow up. Bug: angleproject:6851 Bug: angleproject:8133 Change-Id: I77f4d514ff4aeef85bc1cc59214f7caa23aca7df Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4443186 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Mark Lobodzinski 1810995c 2023-04-25T13:09:27 Capture/Replay: Initialize MEC alpha test state Fixes Street Fighter IV CE rendering issues when capturing. Test: angle_trace_tests --gtest_filter="*street_figher_iv_ce*" Bug: b/278606770 Change-Id: Ifb44c45b19514e4cabed1e81be99bce5706ac4d3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4475732 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Mark Łobodziński <mark@lunarg.com>
Constantine Shablya e975f9dc 2022-11-09T06:44:06 Capture/Replay: handle paletted textures Add a method for recompressing paletted textures on capture. Bug: angleproject:7710 Change-Id: I11af0c1cd7c3b63850c5daf96eafcd3efce65f16 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4178311 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Alexey Knyazev e809e7bd 2023-03-13T00:00:00 Reland "Implement EXT_depth_clamp" This is a reland of commit f8c1418319ac2aef4b3101e322005b1d0f73120f Host GPU bugs are observable in iOS Simulator Original change's description: > Implement EXT_depth_clamp > > * Added depthClamp to the RasterizerState > * Added DepthWriteTest end2end tests covering > both clipped and clamped depth writes > > Capture > * Updated serialized rasterizer state > * Updated CaptureMidExecutionSetup > > OpenGL > * Requires GL 3.2 or ARB_depth_clamp > on desktop contexts > * Maps to EXT_depth_clamp on ES > > D3D11 > * Maps to the opposite of > D3D11_RASTERIZER_DESC.DepthClipEnable > * The new tests uncover several edge cases where > a workaround is needed to implement unextended > OpenGL semantics on top of D3D > > Metal > * Maps to the setDepthClipMode command > > Bug: angleproject:8047 > Bug: angleproject:8077 > Change-Id: I1b3448e5b84443e4be18af9bc22d2f8495ac8267 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4347753 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Bug: angleproject:8047 Bug: angleproject:8077 Change-Id: I8c5f8304276c97c51b2c3382cd2764592ee0c3fe Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4349938 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Yuxin Hu 4a77b0f5 2023-03-18T00:16:24 Revert "Implement EXT_depth_clamp" This reverts commit f8c1418319ac2aef4b3101e322005b1d0f73120f. Reason for revert: This change breaks angle_end2end_tests on Metal backend: https://ci.chromium.org/ui/p/chromium/builders/ci/ios-angle-intel/26035/overview Original change's description: > Implement EXT_depth_clamp > > * Added depthClamp to the RasterizerState > * Added DepthWriteTest end2end tests covering > both clipped and clamped depth writes > > Capture > * Updated serialized rasterizer state > * Updated CaptureMidExecutionSetup > > OpenGL > * Requires GL 3.2 or ARB_depth_clamp > on desktop contexts > * Maps to EXT_depth_clamp on ES > > D3D11 > * Maps to the opposite of > D3D11_RASTERIZER_DESC.DepthClipEnable > * The new tests uncover several edge cases where > a workaround is needed to implement unextended > OpenGL semantics on top of D3D > > Metal > * Maps to the setDepthClipMode command > > Bug: angleproject:8047 > Bug: angleproject:8077 > Change-Id: I1b3448e5b84443e4be18af9bc22d2f8495ac8267 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4347753 > Reviewed-by: Geoff Lang <geofflang@chromium.org> > Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com> Bug: angleproject:8047 Bug: angleproject:8077 Change-Id: I829add68c006c72b7b4acf03aee3efa8a9a16fac No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4350876 Reviewed-by: Alexis Hétu <sugoi@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
Alexey Knyazev f8c14183 2023-03-13T00:00:00 Implement EXT_depth_clamp * Added depthClamp to the RasterizerState * Added DepthWriteTest end2end tests covering both clipped and clamped depth writes Capture * Updated serialized rasterizer state * Updated CaptureMidExecutionSetup OpenGL * Requires GL 3.2 or ARB_depth_clamp on desktop contexts * Maps to EXT_depth_clamp on ES D3D11 * Maps to the opposite of D3D11_RASTERIZER_DESC.DepthClipEnable * The new tests uncover several edge cases where a workaround is needed to implement unextended OpenGL semantics on top of D3D Metal * Maps to the setDepthClipMode command Bug: angleproject:8047 Bug: angleproject:8077 Change-Id: I1b3448e5b84443e4be18af9bc22d2f8495ac8267 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4347753 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Alexey Knyazev bf5e9dbc 2023-03-09T00:00:00 GL: Reset clip origin before scissored clears Clip origin must not affect scissor box but some drivers flip it for clear operations. Added capture/replay support for ClipControl. Bug: angleproject:8066 Change-Id: I9292cb4945b49c56c80da4c5813e89df3453b6b6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4328267 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
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>
Gert Wollny 0e9b8f36 2023-02-08T13:39:09 Capture/Replay: Drop context ID from file and frame func names This is needed when we want to be able to deal with swap called from different contexts. Bug: angleproject:7911 Change-Id: I83023308109852179f434be2290b33b7844ddcda Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4236540 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Gert Wollny a52c0a6c 2023-02-06T16:01:27 Capture/Replay: Add and handle new resource type for EGLSync So far calls involving EGLSync were not tracking the actual sync objects, and this may lead to race conditions in multi-threaded and multi-context scenarios. This CL adds the type EGLSyncID and some specialized code handling of egl::Sync to distinguish EGLSync from the already existing GLSync objects in order to track them separately. Bug: angleproject:7911 Change-Id: I91b188a41069bc0620f51c55ee516d23b55bdd38 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4200095 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Gert Wollny 111aca40 2023-02-15T14:06:15 Capture/Replay: Emit NULL instead of nullptr in trace When created C traces the value "nullptr" is not defined, so emit NULL instead, because this is supported in both, C and C++. Bug: angleproject:8018 Change-Id: I77584c462b1b02df39871929c1979d7ee7624361 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4254388 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Gert Wollny 91bd7e6e 2023-01-09T15:57:35 Capture/Replay: VertexArrayState: also track binding index too We have to capture the case when only the binding index is not at the default value. Bug: angleproject:7912 Change-Id: Id08b20788422694db60f38c6e0b8b4a9191890c0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4143841 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Gert Wollny <gert.wollny@collabora.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>
Cody Northrop 0931b679 2023-01-26T13:20:22 FrameCapture: Update shader capture for CRLF Shaders with CRLF were breaking the way we capture strings after the move to C format, causing compile failures. To fix, strip out carriage returns ("\r") before splitting the string. See previous patchsets on this CL to see other approaches we tried. Test: LIMBO and Pokemon Masters EX traces Bug: angleproject:7945 Bug: angleproject:7953 Change-Id: Ia15d3a098cb4fcad85a7d7dbd365acdbff8346ce Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4159055 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Alexey Knyazev ef0fe638 2023-01-16T00:00:00 Implement EXT_polygon_offset_clamp * Added polygonOffsetClamp to the RasterizerState * Adjusted State::setPolygonOffsetParams * Added PolygonOffsetClampTest end2end tests * Added StateChangeTestES3.PolygonOffsetClamp test * Suppressed the affected dEQP test as it has a bug Capture * Updated serialized rasterizer state * Updated CaptureMidExecutionSetup OpenGL * Rely on the EXT extension defined both for desktop and ES contexts * On desktops, might as well use the ARB extension or GL 4.6 once ANGLE supports them D3D11 * Requires FL10_0 or higher * Maps to D3D11_RASTERIZER_DESC.DepthBiasClamp * Drive-by cleanup of extensions init code Vulkan * Requires depthBiasClamp physical device feature * Maps to the depthBiasClamp parameter of the vkCmdSetDepthBias command Metal * Maps to the clamp parameter of the setDepthBias command Bug: angleproject:7957 Change-Id: If6b28df4084f0a81db29f75fb434e75d394c8730 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4169945 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Alexey Knyazev <lexa.knyazev@gmail.com>
Roman Lavrov dfcdae3b 2023-01-23T15:59:49 FrameCapture: Add blend state updates to resetCalls. Adds calls to ResetReplay if modified during capture, for example: glBlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD); glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE, GL_SRC_ALPHA, GL_ONE); glBlendFunc and glBlendFuncSeparate need to be "merged" into a single path to avoid both being tracked while using the same underlying state, so I mapped them both to glBlendFuncSeparate. Also handling glBlendEquation the same way, previously only glBlendEquationSeparate calls were tracked. Test: Bubble Shooter with Friends MEC Bug: b/266244734 Change-Id: I02c4a0da46f35aa496308bf9df6ac15f3297de27 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4189035 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Jamie Madill 2c582dcb 2023-01-03T10:27:03 Trace Interpreter: Support Manhattan trace. Adds the following fixes and features: - support transform feedback varying strings - support infinity and NaN constants - support for sampler and query resources Bug: angleproject:7887 Change-Id: Ib01afe66e4fda9bc77d0cb5eed52fa83a694a7d6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4126885 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
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>
Roman Lavrov 56eb961f 2023-01-17T17:03:39 Revert "Capture/Replay: Capture the attr locations as set by the program" This reverts commit 585d2a9e5c546c7aa59b987da6c70d310cccd3ee. Reason for revert: glBindAttribLocation calls added by frame capture, even when location was not set explicitly, are currently necessary for replay stability across different platforms. Example from a trace: glGetAttribLocation(gShaderProgramMap[24], "position"); ... glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 112, nullptr); Note how "0" is hard-coded instead of using the value returned by glGetAttribLocation above, and that can be different on a different platform. This was resolved before this CL by calling glBindAttribLocation to map "position" to 0, and after this CL glBindAttribLocation calls are missing from the trace and we end up with inconsistent native replays (found in Android b/265429003) Original change's description: > Capture/Replay: Capture the attr locations as set by the program > > Setting the attribute location based on the input declaration > results in a discrepancy with MEC when recording the context state, > because if a location was never set explicitely, the captured > context state will hold no attribute location information, but > since calls were recorded to set the default attribute locations, > the context state recorded during replay will contain these extra > entries. > > To avoid this, only record the attribute locations that were > explicitely set. > > Bug: angleproject:7564 > Change-Id: Ib9d6c7b098935d199921e0fe5c0ef985e6187f1b > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3827345 > Commit-Queue: Gert Wollny <gert.wollny@collabora.com> > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Cody Northrop <cnorthrop@google.com> Bug: angleproject:7564 Bug: angleproject:7964 Bug: b/265429003 Change-Id: I4f97c8162601cc1b749bbc8a06851561654205e6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4172756 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Roman Lavrov <romanl@google.com>
Gert Wollny 4194dab4 2023-01-09T12:03:47 Capture/Replay: Test the correct context ID when emitting setup Fixes: b432c84c2b8cb6d20873e2b33b6684bee76db90d (origin/chromium/5455) Capture/Replay: Fix collecting the initialized contexts Bug: angleproject:7805 Bug: angleproject:7938 Change-Id: Ia321179bef8fd33c7968177ffcb4da78103a99fc Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4143840 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Jamie Madill 18950e64 2023-01-05T11:33:59 Capture/Replay: Fix unpack alignment inconsistency. We were checking the current value of the unpack alignment in the replay when we should have been comparing vs the set value in the context. Bug: angleproject:7816 Change-Id: Ib7e6ed785e07e06a7f55f4b727f640912b75b7a6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4139299 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com> Auto-Submit: Jamie Madill <jmadill@chromium.org>
Cody Northrop b354667e 2022-12-24T12:21:17 FrameCapture: Fix tracking of glCopyImageSubData When tracking texture updates during glCopyImageSubData, choose an enum supported by PackedEnum when looking up the textureID. Also add a test for a common pattern used by the Unreal Engine that trips up FrameCapture. Test: CopyImageTestES31.CubeMapCopyImageSubData/* Bug: angleproject:7913 Change-Id: I6c0fee69064cc6dc81177093ec9461dd5ccc152a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4126449 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: 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>
Gert Wollny f7cf3226 2022-12-08T10:08:56 Capture/Replay: Only create active secondary contexts in MEC This finalized the fix attempted in b432c84c2b8cb6d20873e2b33b6684bee76db90d Capture/Replay: Fix collecting the initialized contexts Bug: angleproject:7858 Change-Id: Ie2bbcdb3f23fe4970ce3a9bb46df6f60fe6c8ab6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4084926 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
Gert Wollny 384ce5cf 2022-11-29T14:18:34 Capture/Replay: Corretly reset the UnpackAlignment at end of MEC Direcly setting the value doesn't set the relevant dirty state, use the appropriate setter call instead. This fixes the reported difference between the UnpackAlignment value stored in the trace and the one recorded ruring validation for MEC. Bug: angleproject:7564 Bug: angleproject:7180 Change-Id: Ic931cac9b7e33519e992ae55ee5cab2adb2958ca Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4063892 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
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>
Gert Wollny 494640e5 2022-11-18T12:02:28 Capture/Replay: Make secondary contexts current during MEC When replaying, the context is made current at the beginning of the context setup function, and is still current when we hot the validation point at the end of the setup function. When a context is current is has a valid default framebuffer, and hence, during a replay of the trace the context serialization will contain this framebuffer. However, during MEC the secondary contexts were not made current during capture, and hence they dind't have a default framebuffer which resulted in a validation error. Therefore, make the secondary contexts current when they are captured during MEC to make sure we also capture the default framebuffer. Bug: angleproject:7812 Change-Id: Iaccc4150e8a71a02286e772882fb150bef1d82a8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4037982 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Lubosz Sarnecki 2fa255da 2022-11-09T16:44:02 FrameCapture: Don't capture trailing zeros in shader strings. This prevents C build errors like the following when applications provide incorrect shader string lengths: error: null character(s) preserved in string literal Bug: angleproject:7402 Change-Id: Iac7bab58533d152c4b6ed525f0cbcbcb8a7c35ad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4020417 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Gert Wollny 66fda678 2022-11-14T11:10:54 Capture/Replay: Delete buffer after test support for coherent The buffer created to test coherent and persistzent mapping is not used later, so it should be deleted. Since this buffer is created and deleted before any VAO is created, we also have to check whether a VAO exists before the buffer may be detached from it. Bug: angleproject:7814 Change-Id: I875f845e592325093dd90b48ba9cd3c7228fad47 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4023047 Reviewed-by: Cody Northrop <cnorthrop@google.com> 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 335b5aba 2022-11-07T09:28:10 Capture/Replay: Make CaptureMidExecutionSetup param constant There is no need for for the context parameter to be non-constant. Bug: angleproject:7805 Change-Id: I1d998cf40f61a977ebce6d1160a859e082d99688 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4008198 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
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>
Lubosz Sarnecki 7fa69511 2022-11-04T10:10:05 FrameCapture: Skip glGetActiveUniformBlockName calls. Since moving to plain C traces removed references to uniform block indices, this call should also be part of the related skip list. This fixes capturing traces using the call an not hitting UNREACHABLE when handling TUniformBlockIndex. Bug: angleproject:7731 Bug: angleproject:7402 Change-Id: I510aceaa0965c2469367212784b504ea251a2541 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4003222 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Gert Wollny 27561f04 2022-10-30T09:38:00 Capture/Replay: Emit always gContextMap2 when capturing traces Bug: angleproject:7800 Change-Id: I12fc39d709527865a9b248a00c95d281c4e4d743 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3993317 Reviewed-by: Cody Northrop <cnorthrop@google.com> 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 dc62b3ee 2022-10-10T21:00:16 Capture/Replay: Add trace interpreter. Also adds a self-test using the retrace script. Bug: angleproject:7752 Change-Id: I1985b47250bef99726d2ca2d90bef859208e357e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3965128 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@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>
Cody Northrop 596c2acf 2022-10-20T18:59:04 FrameCapture: Fix FenceSync for MEC Follow up to: https://chromium-review.googlesource.com/c/angle/angle/+/3957164 Test: MEC for Grimvalor Bug: angleproject:7758 Change-Id: Ia0895e923d9bee41bcfbff48d15bf9aa86e29d17 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3969519 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 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 fd45cec3 2022-10-10T20:59:58 Entry Points: Move enum helper to registry_xml. This will make it accessible to other generators. Bug: angleproject:7752 Change-Id: I91bc9a4d6c919266ea329f66d271bf881d99d17a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3963364 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
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 5ec6f8dd 2022-10-10T20:59:42 Capture/Replay: Only inline strings. This will simplify the trace code and the parsing logic. Previously we wrote some integer data in the cpp file, e.g.: const GLenum glDiscardFramebufferEXT_attachments_0[] = {...}; glDiscardFramebufferEXT(..., glDiscardFramebufferEXT_attachments_0); Bug: angleproject:7731 Change-Id: If7924b1bf231f584f4677a438232bedc7ea9bd69 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3953338 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Yuxin Hu <yuxinhu@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 4f85f862 2022-10-10T20:59:19 Capture/Replay: Remove references to uniform block indexes. This removes the references in captured traces to the uniform block index map. Because uniform block indexes use a double indirection, we store them in an unordered map. Moving to plain C precludes all uses for templated types, so we need to funnel the calls through a custom function. Bug: angleproject:7731 Change-Id: I35ae010b880ee669df09d750d5fb26d3baf907cd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3953334 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
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>
Shahbaz Youssefi 135022e4 2022-10-11T00:03:11 Vulkan: Create robust pipelines based on context state Previously, pipelines were made robust based on whether any context in the share group has so far been made robust. This means that pipelines created on non-robust contexts would still be compiled as robust. Inefficiency aside, this was buggy because robustness was not part of the pipeline cache key, so if a pipeline was created as non-robust first, then recreated in a robust context, it would reuse the non-robust variant. With VK_EXT_pipeline_protected_access, a similar situation arises for context protected-ness. However, it is incorrect in that case to create pipelines as protected unnecessarily. This change makes pipeline robustness a part of the pipeline cache key, in preparation for protectedness to be added similarly. Compute programs may now generate multiple pipelines as a result too. Bug: angleproject:7629 Change-Id: Ie95f10eff878f8c8b221c1018da44385c7aad15e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3943534 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Charlie Lao <cclao@google.com>
Gert Wollny f2785e41 2022-10-10T08:21:36 capture/replay: validate after resetting unpack alignment Otherwise validation will fail, because we try to validate the temporary set alignment against the alignment that would be active without MEC. Bug: angleproject:7564 Bug: angleproject:7180 Change-Id: I40cac84be122c779b9beba39f155567f9edbee75 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3936631 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Gert Wollny <gert.wollny@collabora.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 63c54da3 2022-09-29T22:32:54 FrameCapture: Fix default uniform sampler base loc Follow up to: https://chromium-review.googlesource.com/c/angle/angle/+/3928253 Samplers are handled specially above the previous changes. Test: Darkness Rises MEC Bug: angleproject:7719 Bug: angleproject:7720 Change-Id: I72848eaced4da379fe724aebf61a75616f614e1c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3929328 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Roman Lavrov <romanl@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>
Lubosz Sarnecki dbb9f38d 2022-09-13T12:08:02 FrameCapture: Capture Texture Environment in MEC. Persist the state of glTexEnv in mid-execution capture for OpenGL ES 1.X contexts. Implement equality operators overload for the TextureEnvironmentParameters struct. Test: angle_end2end_tests --gtest_filter="TextureEnvTest.*" Bug: angleproject:7652 Change-Id: I131eec5c838c9e434e135bd3c6b050fca44c3231 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3892015 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Cody Northrop 9393fd54 2022-09-13T20:06:57 FrameCapture: Ignore GetActiveAttrib Similar to how we skip glGetActiveUniform, we also need to skip glGetActiveAttrib. Attribute active status varies based on the underlying shader compiler. More aggresive stacks can find ways to eliminate them. If the application asks about attributes above GL_ACTIVE_ATTRIBUTES, a GL error is thrown, causing a trace to be non-portable. Tested with Eve Echoes and Monster Hunter Stories. Also added an end2end test that showcases a way apps ask about attributes, verified we can capture and replay it across multiple vendors now. Test: VertexAttributeTestES3.UnusedAttribsMEC Bug: angleproject:7215 Bug: angleproject:7557 Bug: angleproject:7402 Change-Id: I3c655bcead0ddb1677f8e1d49cb7d3f3c6b4feba Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3866041 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Cody Northrop 8581e5fa 2022-08-05T14:52:22 FrameCapture: Improve renderbuffer reset Add support for recording calls to regenerate renderbuffers, and track when renderbuffers are deleted. Test: Monster Hunter Stories MEC Bug: angleproject:7557 Bug: angleproject:4599 Change-Id: Ib32abaaf4b5f4767c5c9ede312a29e7f108bd93d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3815224 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Gert Wollny 585d2a9e 2022-08-11T16:45:54 Capture/Replay: Capture the attr locations as set by the program Setting the attribute location based on the input declaration results in a discrepancy with MEC when recording the context state, because if a location was never set explicitely, the captured context state will hold no attribute location information, but since calls were recorded to set the default attribute locations, the context state recorded during replay will contain these extra entries. To avoid this, only record the attribute locations that were explicitely set. Bug: angleproject:7564 Change-Id: Ib9d6c7b098935d199921e0fe5c0ef985e6187f1b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3827345 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Cody Northrop 1cac338a 2022-08-30T11:15:16 FrameCapture: Fix GLES1 vertex array state This CL restores the check for default state before binding a vertex array in Setup. When hooking up reset of Vertex Array state, we inadvertently started recording glBindVertexArray, even for default state. This prevented traces from running on GLES1 implementations that don't support GL_OES_vertex_array_object. Test: Wayward Souls MEC Bug: angleproject:7507 Bug: angleproject:7608 Change-Id: I7aea74b7eb66c0e79a04d81c2dce61fa33dde807 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3863877 Reviewed-by: Jamie Madill <jmadill@chromium.org> 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>
Lubosz Sarnecki 68b6206e 2022-08-19T16:39:01 FrameCapture: Fix capturing glBindRenderbuffer on GLES1. Use FramebufferCaptureFuncs when capturing glBindRenderbuffer calls on GLES1 contexts, since they require the GL_OES_framebuffer_object extension and will otherwise crash on certain native GL drivers. Bug: angleproject:7596 Change-Id: I7be1b0dee38c9186b657489ca76bf769f47caeb1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3849478 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Gert Wollny b688c909 2022-08-11T13:14:49 Capture/Replay: save and restore UNPACK_ALIGNMENT in MEC MEC replay requires an unpack alignment of one. When creating a trace the call to set this alignment is emitted, but it is not actually set in the context, so that the captured context state records the actual unpack alignment. When replaying, the call to set the unpack alignment to one is executed, and the context state changed, so that comparing the captured context to the replay context will fail if the original alignement was not one. Restore the original alinment in the context setup functions to ensure that the context state holds the same state information when replaying like when the trace was captured. Bug: angleproject:7564 Bug: angleproject:7180 Change-Id: I09d9bf77bc0193bdf9f41b6183f1ee8d66c5e563 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3827346 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Lubosz Sarnecki 15b1678f 2022-08-19T13:13:42 FrameCapture: Add VertexArrayCaptureFuncs. Analogously to FramebufferCaptureFuncs, append OES suffixes to vertex array related functions on GLES1 contexts. These functions require the GL_OES_vertex_array_object extension and will crash on certain native drivers without the OES suffix. This resolves the following validation error when replaying GLES1 traces captured using MEC on ANGLE: glBindVertexArray: GL error: HIGH: OpenGL ES 3.0 Required. Bug: angleproject:7596 Bug: angleproject:7608 Change-Id: I603efae4a8d61b84b7711effb2e7e1d8d52e3d83 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3849477 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Cody Northrop 94a23a4e 2022-08-21T19:52:50 FrameCapture: Fix separable shader uniform locs Uniform locations are tracked by traced program ID, not remapped program ID. This was creating code that used incorrect locations and would immediately crash. For instance, the following code: glProgramUniform4fv(gShaderProgramMap[92], gUniformLocations[gShaderProgramMap[92]][12], 1, reinterpret_cast<const GLfloat *>(&gBinaryData[0])); gShaderProgramMap[92] happens to remap to 54 during replay. But if you look in UpdateUniformLocation, we track uniform locations based on the trace program (92): // Example call: UpdateUniformLocation(92, "fullmatrix", 0, 1); void UpdateUniformLocation(GLuint program, const char *name, GLint location, GLint count) { ... gUniformLocations[program] = programLocations.data(); } So when gUniformLocations[gShaderProgramMap[92]] is used, it tries to look up uniform locations for 54, which don't exist, and returns nullptr. To fix, don't use gShaderProgramMap when looking up locations of uniforms. This only affects separable programs. Normal glUniform calls use gCurrentProgram which is already the trace program (92). The new code looks like this: glProgramUniform4fv(gShaderProgramMap[92], gUniformLocations[92][12], 1, reinterpret_cast<const GLfloat *>(&gBinaryData[0])); Test: Antutu Refinery MEC Bug: angleproject:7590 Change-Id: I079923ec8d938356e72e929d61f80c7fc371a95b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3844642 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Cody Northrop 429a7cab 2022-08-21T19:50:32 FrameCapture: Fix cube face as framebuffer This fix is required for Antutu Refinery benchmark, which has cube faces mapped as framebuffer attachments. Test: Antutu Refinery MEC Bug: angleproject:7590 Change-Id: I5eec5fcbe12ac7486499b047a4b7564b3bc2690f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3844641 Commit-Queue: Cody Northrop <cnorthrop@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>
Sean Risser 266d0a83 2022-08-09T22:08:03 Skip glObjectLabel in replay capture Similar entry points are also skipped, so it's likely the list was just missing this one. Bug: angleproject:7567 Change-Id: I1d7e37b35960fd71fdec9143d9193dee6f97e1f1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3824777 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
Faye Zhang 4c941149 2022-08-12T11:42:07 External Texture Support In MEC Bug: angleproject:4964 Change-Id: I5cfbadf515a30fb20d75b2d745fdecdafa12268f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3812378 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Auto-Submit: Faye Zhang <ffz@google.com> Commit-Queue: Faye Zhang <ffz@google.com> Reviewed-by: Cody Northrop <cnorthrop@google.com>
Eddie Hatfield 2ebd5100 2022-08-11T10:43:32 Add gl::Context as a parameter to Shader::resolveCompile This prepares us to access the Context's shader cache in resolveCompile in the next commit. Bug: angleproject:7036 Change-Id: I7995c54b290a5a48f0c8985cb56ea0048598ab2f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3827642 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Peng Huang a2ad517f 2022-08-06T07:54:16 Replace std::vector with angle::FixedVector in FramebufferState. Using std::vector causes heap allocation for all new framebuffers, so change it to angle::FixedVector. Bug: chromium:1336126 Change-Id: I2e059324d14d59ba2a42b2bb4cd5c569a439a87a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3812563 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org> Auto-Submit: Peng Huang <penghuang@chromium.org>
Cody Northrop 88dd868f 2022-07-25T06:44:38 FrameCapture: Fix and optimize multi-context reset Follow on to fd89020c This CL: - Fixes missing eglMakeCurrent calls when switching contexts to reset container state - Optimizes when those calls are made, so we only call eglMakeCurrent in Reset when we absolutely have to - Moves MaybeResetContextState to the end, after any per-context reset work has been done Test: Asphalt 9 MEC Bug: angleproject:4599 Bug: angleproject:7507 Change-Id: I52912aa13e3a11735ed3ec93080a21e9cbff113a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3784728 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
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 eb88a2ac 2022-07-11T17:16:49 Capture/Replay: Handle the case when there is no context in eglCreateImageKHR, when target is EGL_NATIVE_BUFFER_ANDROID then the context must be EGL_NO_CONTEXT, so handle this case. Bug: angleproject:4964 Change-Id: I945d2af546f3f3a14be966e5cac795b58aa3c89f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3755785 Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: Faye Zhang <ffz@google.com>
Geoff Lang 785353fd 2022-05-24T12:40:16 Support Desktop OpenGL context creation in end2end tests Validation of Desktop GL versions and profile masks is unimplemented. Bug: angleproject:7360 Change-Id: Ifae94215b6aada895c2b02318a1d05c9515e9b96 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3664916 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@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>
Gert Wollny e55990e3 2021-10-20T19:32:59 Capture/Replay: Handle arrays with uniform block indices When we update the uniform block indices we have to take into accountg that there may be arrays and that the indices of array elements can be retrived by querying with an index. Consider a layout layout(std140) uniform Data { vec4 plainData; vec4 arrayData[3]; } buffers; Then the loop for updating the uniform block indices will see [ "plainData", "arrayData", "arrayData", "arrayData" ] and we have to take care to add the array indices if they are greaten than zero, otherwise we would always query the index of the first array element. Bug: angleproject:6180 Change-Id: I21f96ab49c1c33bc4024711b72df961377afea4e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3198881 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
Peng Huang 445bf9bd 2022-04-09T08:42:12 Use the real max vertex attrib index instead of MAX_VERTEX_ATTRIBS Bug: chromium:1258869 Change-Id: I7de23353fc6922be9b3201c87d33e0cfdc427569 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3580578 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
Cody Northrop 808f754c 2022-04-04T17:53:48 Capture/Replay: Use glFramebufferTexture2D for cubes In GLES 3.2, you can use glFramebufferTexture2D or glFramebufferTextureLayer to bind a cube face as an attachment. Not all drivers support glFramebufferTextureLayer because the wording of the spec is confusing. Instead use the more portable glFramebufferTexture2D. Test: Aztec Ruins High MEC Bug: angleproject:7168 Bug: angleproject:7169 Change-Id: Ie1a7d06f817750ddf8e6e707814380e306f5ee29 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3570242 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: 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>
Cody Northrop 04680183 2022-03-24T11:09:39 Capture/Replay: Fixes for Car Chase This CL contains two fixes: * Add GL_PATCHES to list of PrimitiveMode names * Use FramebufferTextureLayer for 3D and Cube textures Bug: angleproject:3662 Bug: angleproject:7125 Bug: b/218314686 Change-Id: Ia97d8221cb78ef6e895156b5a474483d570d6ab5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3551096 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Cody Northrop <cnorthrop@google.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>
Lubosz Sarnecki 70af5ff0 2022-02-18T14:35:59 FrameCapture: Skip invalid VertexAttribPointer calls in MEC. In CaptureVertexArrayState when a non-default VAO is bound and no GL_ARRAY_BUFFER is bound, VertexAttribPointer calls with a non-null offset are invalid and will produce: "Client data cannot be used with a non-default vertex array object." Add a test that leaves a vertex array with an invalid vertex attribute pointer and used to produce an invalid trace with MEC. Test: angle_end2end_tests --gtest_filter="VertexAttributeTestES3.InvalidAttribPointer/*" Bug: angleproject:7042 Bug: angleproject:7098 Change-Id: Iaf91fe7f191c44df79db47bb5455e5df922f2ed5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3475353 Reviewed-by: Cody Northrop <cnorthrop@google.com> 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>
Gert Wollny 5118002e 2021-11-29T21:01:03 Capture/Replay: test and handle texture gen-on-bind Bug: angleproject:6425 Change-Id: Ieb4c0a7a6ffdbf0690c07c10e001835a0dcbb6e1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3295620 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
Gert Wollny bc20e55b 2021-11-29T21:00:45 Capture/Replay: test and handle renderbuffer gen-on-bind Bug: angleproject:6425 Change-Id: I591bf0fdfe2e7f83d7e02f63c8265234f7b85df6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3295618 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
Gert Wollny efb951e8 2021-11-29T21:00:02 Capture/Replay: test and handle buffer gen-on-bind Bug: angleproject:6425 Change-Id: If8b573d0d77192befe6db82498158c535bd3b104 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3295619 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Gert Wollny <gert.wollny@collabora.com>
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 d98f4812 2022-02-17T15:22:22 FrameCapture: Capture empty buffer generation. This avoids emitting VertexAttribPointer with non-null offsets when the array buffer is empty and a vertex array is bound in MEC. When no buffer is bound, which was also the case if the buffer was empty, non-null offsets are not allowed in VertexAttribPointer and will result in: "Client data cannot be used with a non-default vertex array object." Add EmptyArrayBuffer test to VertexAttributeTestES3. Test: angle_end2end_tests --gtest_filter="VertexAttributeTestES3.EmptyArrayBuffer/*" Bug: angleproject:7026 Change-Id: I0cb02a5588f5d2bbc85f58b75fd14493b644d52b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3468524 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Cody Northrop 9e323299 2022-02-02T18:09:36 FrameCapture: Regen framebuffers on Reset Regenerate framebuffers that have been deleted and recreated during the run. This required changing the order of how resources are updated during Reset. Textures need to come before framebuffers so they can be regenerated before being bound. Test: MEC of genshin_impact trace frames 2-100 Bug: angleproject:6893 Change-Id: I0d14e09a5e378e7553dec54f4608eefe1bf397dd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3435112 Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>