1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Send time deltas in GPU time events.

This commit is contained in:
Bartosz Taudul
2019-10-25 19:52:01 +02:00
parent 1ce25d3aef
commit 0f2503d334
6 changed files with 27 additions and 5 deletions
+17
View File
@@ -1316,6 +1316,7 @@ void Profiler::Worker()
m_threadCtx = 0;
m_refTimeSerial = 0;
m_refTimeCtx = 0;
m_refTimeGpu = 0;
#ifdef TRACY_ON_DEMAND
OnDemandPayloadMessage onDemand;
@@ -1802,6 +1803,14 @@ Profiler::DequeueStatus Profiler::Dequeue( moodycamel::ConsumerToken& token )
MemWrite( &item->threadWakeup.time, dt );
break;
}
case QueueType::GpuTime:
{
int64_t t = MemRead<int64_t>( &item->gpuTime.gpuTime );
int64_t dt = t - m_refTimeGpu;
m_refTimeGpu = t;
MemWrite( &item->gpuTime.gpuTime, dt );
break;
}
default:
assert( false );
break;
@@ -1964,6 +1973,14 @@ Profiler::DequeueStatus Profiler::DequeueSerial()
MemWrite( &item->gpuZoneEnd.cpuTime, dt );
break;
}
case QueueType::GpuTime:
{
int64_t t = MemRead<int64_t>( &item->gpuTime.gpuTime );
int64_t dt = t - m_refTimeGpu;
m_refTimeGpu = t;
MemWrite( &item->gpuTime.gpuTime, dt );
break;
}
default:
assert( false );
break;