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

Add transient OpenGL zones.

This commit is contained in:
Bartosz Taudul
2021-01-15 20:13:09 +01:00
parent 69372c2dcb
commit 5a8d30ddc3
4 changed files with 102 additions and 5 deletions
+31
View File
@@ -1771,6 +1771,13 @@ static void FreeAssociatedMemory( const QueueItem& item )
ptr = MemRead<uint64_t>( &item.zoneBegin.srcloc );
tracy_free( (void*)ptr );
break;
case QueueType::GpuZoneBeginAllocSrcLoc:
case QueueType::GpuZoneBeginAllocSrcLocCallstack:
case QueueType::GpuZoneBeginAllocSrcLocSerial:
case QueueType::GpuZoneBeginAllocSrcLocCallstackSerial:
ptr = MemRead<uint64_t>( &item.gpuZoneBegin.srcloc );
tracy_free( (void*)ptr );
break;
case QueueType::CallstackMemory:
case QueueType::Callstack:
ptr = MemRead<uint64_t>( &item.callstackFat.ptr );
@@ -1976,6 +1983,18 @@ Profiler::DequeueStatus Profiler::Dequeue( moodycamel::ConsumerToken& token )
MemWrite( &item->gpuZoneBegin.cpuTime, dt );
break;
}
case QueueType::GpuZoneBeginAllocSrcLoc:
case QueueType::GpuZoneBeginAllocSrcLocCallstack:
{
int64_t t = MemRead<int64_t>( &item->gpuZoneBegin.cpuTime );
int64_t dt = t - refThread;
refThread = t;
MemWrite( &item->gpuZoneBegin.cpuTime, dt );
ptr = MemRead<uint64_t>( &item->gpuZoneBegin.srcloc );
SendSourceLocationPayload( ptr );
tracy_free( (void*)ptr );
break;
}
case QueueType::GpuZoneEnd:
{
int64_t t = MemRead<int64_t>( &item->gpuZoneEnd.cpuTime );
@@ -2206,6 +2225,18 @@ Profiler::DequeueStatus Profiler::DequeueSerial()
MemWrite( &item->gpuZoneBegin.cpuTime, dt );
break;
}
case QueueType::GpuZoneBeginAllocSrcLocSerial:
case QueueType::GpuZoneBeginAllocSrcLocCallstackSerial:
{
int64_t t = MemRead<int64_t>( &item->gpuZoneBegin.cpuTime );
int64_t dt = t - refSerial;
refSerial = t;
MemWrite( &item->gpuZoneBegin.cpuTime, dt );
ptr = MemRead<uint64_t>( &item->gpuZoneBegin.srcloc );
SendSourceLocationPayload( ptr );
tracy_free( (void*)ptr );
break;
}
case QueueType::GpuZoneEndSerial:
{
int64_t t = MemRead<int64_t>( &item->gpuZoneEnd.cpuTime );