From a03c657cb5d3b8c158c17cf4200932f854434b03 Mon Sep 17 00:00:00 2001 From: Alan Tse Date: Tue, 27 Oct 2026 02:32:29 -0700 Subject: [PATCH] fix(d3d11): resume GPU timing after reconnect When the client disconnects while a disjoint query result is pending, the not-connected branch of Collect resets the checkpoints without re-issuing Begin. The next connected Collect then calls End twice, so no GpuTime items are produced and every later connection shows GPU zones with no timings. Drain the pending result and Begin the query before resetting. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01L3DnWkXakGRgz9C8BaLM47 --- public/tracy/TracyD3D11.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/public/tracy/TracyD3D11.hpp b/public/tracy/TracyD3D11.hpp index dac9388e..00741f6f 100644 --- a/public/tracy/TracyD3D11.hpp +++ b/public/tracy/TracyD3D11.hpp @@ -183,6 +183,12 @@ public: #ifdef TRACY_ON_DEMAND if( !GetProfiler().IsConnected() ) { + if( m_previousCheckpoint != m_nextCheckpoint ) + { + D3D11_QUERY_DATA_TIMESTAMP_DISJOINT disjoint = { }; + if( m_immediateDevCtx->GetData( m_disjointQuery, &disjoint, sizeof( disjoint ), D3D11_ASYNC_GETDATA_DONOTFLUSH ) != S_OK ) return; + m_immediateDevCtx->Begin( m_disjointQuery ); + } m_previousCheckpoint = m_nextCheckpoint = m_queryCounter; return; }