From 85789a8a138ea589625be8bf439d32dbee7df3db Mon Sep 17 00:00:00 2001 From: Marcos Slomp Date: Thu, 2 Apr 2026 10:35:56 -0700 Subject: [PATCH] minor refactoring --- public/tracy/TracyD3D12.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/public/tracy/TracyD3D12.hpp b/public/tracy/TracyD3D12.hpp index 908db106..7778f84c 100644 --- a/public/tracy/TracyD3D12.hpp +++ b/public/tracy/TracyD3D12.hpp @@ -293,8 +293,7 @@ namespace tracy void Collect() { #ifdef TRACY_ON_DEMAND - if (!GetProfiler().IsConnected()) - return; + if (!GetProfiler().IsConnected()) return; #endif ZoneScopedC(Color::Red4); ZoneValue(uint64_t(m_contextId)); @@ -323,13 +322,14 @@ namespace tracy UINT64 gpuZoneBeginTimestamp = timestampBuffer[queryId]; UINT64 gpuZoneEndTimestamp = timestampBuffer[queryId+1]; UINT64 baselineTimestamp = m_shadowBuffer[queryId+1]; + AgeTime ini = m_queryRequestTime[queryId+1]; int64_t diff = Distance(baselineTimestamp, gpuZoneEndTimestamp); - //if (diff == 0) - // DebugBreak(); + if (diff == 0) + DebugBreak(); if (diff <= 0) { // WARN: reads from m_queryRequestTime[] here may race with writes in NextQueryID() - AgeTime ini = m_queryRequestTime[queryId+1]; + //AgeTime ini = m_queryRequestTime[queryId+1]; if (ini == AgeTime::max()) DebugBreak(); auto age = now - ini; @@ -351,7 +351,6 @@ namespace tracy EmitGpuTime(gpuZoneBeginTimestamp, queryId); EmitGpuTime(gpuZoneEndTimestamp, queryId+1); - UpdateLatestKnownGpuTimestamp(gpuZoneEndTimestamp); m_shadowBuffer[queryId+0] = gpuZoneEndTimestamp; m_shadowBuffer[queryId+1] = gpuZoneEndTimestamp; @@ -382,6 +381,7 @@ namespace tracy MemWrite(&item->gpuTime.queryId, static_cast(queryId)); MemWrite(&item->gpuTime.context, GetId()); Profiler::QueueSerialFinish(); + UpdateLatestKnownGpuTimestamp(gpuTimestamp); TracyD3D12Debug( TracyFreeN(reinterpret_cast(uintptr_t(queryId)), "TracyD3D12|Query"); );