From 0a47038ae3559d855df5af5b6083711f47f946c7 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Tue, 6 Oct 2026 03:26:33 -0400 Subject: [PATCH] [Test] (MG_Remote): read the fence counters before the fence exists, its report can beat a later snapshot --- MobileGL/MG_IntegrationTest/Scenarios/FencePollScenario.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MobileGL/MG_IntegrationTest/Scenarios/FencePollScenario.cpp b/MobileGL/MG_IntegrationTest/Scenarios/FencePollScenario.cpp index b7964791..a69a61ca 100644 --- a/MobileGL/MG_IntegrationTest/Scenarios/FencePollScenario.cpp +++ b/MobileGL/MG_IntegrationTest/Scenarios/FencePollScenario.cpp @@ -130,10 +130,14 @@ namespace MGITest { if (!Ready()) return; const std::string why = SplitRuntimeSkipReason(); if (!why.empty()) GTEST_SKIP() << why; + // The counters are read BEFORE the fence exists: the server may report it while + // glFenceSync's own record is still being applied, and a client call drains the event + // ring, so a snapshot taken after glFenceSync could already include the report and the + // delta below would read 0 for a fence that WAS reported (seen on the verify-split lane). + const SplitRuntimeState before = PeekSplitRuntime(); QueueWork(); GLsync sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); ASSERT_NE(sync, nullptr); - const SplitRuntimeState before = PeekSplitRuntime(); const auto start = Clock::now(); GLenum status = GL_TIMEOUT_EXPIRED; while ((status = glClientWaitSync(sync, 0, 0)) == GL_TIMEOUT_EXPIRED &&