From 83302ca247aab954b48e3702ecf7a785adcf8b59 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Tue, 8 Sep 2026 06:00:46 -0400 Subject: [PATCH] [Test] (MG_Test): scope the pipe resource op table in BufferTest's fixture the way it scopes BufferBackendOps - a push build installs both at bring-up, and these 86 cases are the BufferBackendOps arm's --- MobileGL/MG_Test/Buffer/BufferTest.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/MobileGL/MG_Test/Buffer/BufferTest.cpp b/MobileGL/MG_Test/Buffer/BufferTest.cpp index 0db6d477..7d1f4558 100644 --- a/MobileGL/MG_Test/Buffer/BufferTest.cpp +++ b/MobileGL/MG_Test/Buffer/BufferTest.cpp @@ -15,6 +15,9 @@ #include "Init.h" #include #include +#if MOBILEGL_PIPE_PUSH +#include +#endif #include #include @@ -1647,11 +1650,28 @@ namespace { .ReadbackFromGpu = ZeroCopyMock_ReadbackFromGpu, }; + // These cases are BufferBackendOps dispatch tests. Since P3a a push build also installs the + // handle-shaped MGPipeResourceOps table at backend bring-up, and the frontend's push arms route + // every buffer mutation there first; the fixture therefore scopes BOTH tables, the way + // ResourceEmitTest's ApplierGuard scopes the applier, so the mock installed here is the arm + // that actually runs. The pipe-side dispatch has its own coverage in ResourceEmitTest. struct ScopedBackendOps { explicit ScopedBackendOps(const MG_State::GLState::BufferBackendOps* ops) { MG_State::GLState::SetBufferBackendOps(ops); +#if MOBILEGL_PIPE_PUSH + m_savedResourceOps = MG_Pipe::MGPipeGetResourceOps(); + MG_Pipe::MGPipeSetResourceOps(nullptr); +#endif } - ~ScopedBackendOps() { MG_State::GLState::SetBufferBackendOps(nullptr); } + ~ScopedBackendOps() { +#if MOBILEGL_PIPE_PUSH + MG_Pipe::MGPipeSetResourceOps(m_savedResourceOps); +#endif + MG_State::GLState::SetBufferBackendOps(nullptr); + } +#if MOBILEGL_PIPE_PUSH + const MG_Pipe::MGPipeResourceOps* m_savedResourceOps = nullptr; +#endif }; } // namespace