diff --git a/src/AcDream.App/Rendering/Wb/WbDrawDispatcher.cs b/src/AcDream.App/Rendering/Wb/WbDrawDispatcher.cs index 605b1e6..36ebdc9 100644 --- a/src/AcDream.App/Rendering/Wb/WbDrawDispatcher.cs +++ b/src/AcDream.App/Rendering/Wb/WbDrawDispatcher.cs @@ -772,7 +772,11 @@ public sealed unsafe class WbDrawDispatcher : IDisposable // §3 Q1/Q2 + §4 in // docs/superpowers/specs/2026-05-11-phase-n6-slice1-design.md. int gpuQuerySlot = _gpuQueryFrameIndex % GpuQueryRingDepth; - if (_gpuQueriesInitialized && _gpuQueryFrameIndex >= GpuQueryRingDepth) + // diag is part of the gate so the read/issue/increment trio stays + // symmetric — without it, toggling ACDREAM_WB_DIAG mid-session would + // freeze the frame counter (gated by diag below) while the read kept + // re-reading the same slot, producing duplicate stale samples. + if (diag && _gpuQueriesInitialized && _gpuQueryFrameIndex >= GpuQueryRingDepth) { _gl.GetQueryObject(_gpuQueryOpaque[gpuQuerySlot], QueryObjectParameterName.ResultAvailable, out int avail); if (avail != 0)