src/libANGLE/capture/FrameCapture_mock.cpp


Log

Author Commit Date CI Message
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>
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>
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>