1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 12:23:53 +00:00

Merge pull request #981 from slomp/patch-1

quick-fix for TracyD3D11.hpp
This commit is contained in:
Bartosz Taudul 2025-02-10 18:45:58 +01:00 committed by GitHub
commit 8b3638e8e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -95,6 +95,10 @@ public:
int64_t tcpu0 = Profiler::GetTime();
WaitForQuery(m_disjointQuery);
// NOTE: one would expect that by waiting for the enclosing disjoint query to finish,
// all timestamp queries within would also be readily available, but that does not
// seem to be the case here... See https://github.com/wolfpld/tracy/issues/947
WaitForQuery(m_queries[0]);
int64_t tcpu1 = Profiler::GetTime();
D3D11_QUERY_DATA_TIMESTAMP_DISJOINT disjoint = { };
@ -109,7 +113,7 @@ public:
UINT64 timestamp = 0;
if (m_immediateDevCtx->GetData(m_queries[0], &timestamp, sizeof(timestamp), 0) != S_OK)
continue; // this should never happen, since the enclosing disjoint query succeeded
continue; // this should never happen (we waited for the query to finish above)
tcpu = tcpu0 + (tcpu1 - tcpu0) * 1 / 2;
tgpu = timestamp * (1000000000 / disjoint.Frequency);