mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Disable OpenGL callstacks when fibers are enabled.
This has little impact, but saves much of the hassle.
This commit is contained in:
parent
5ccf369919
commit
733d267768
@ -238,12 +238,15 @@ public:
|
|||||||
const auto queryId = GetGpuCtx().ptr->NextQueryId();
|
const auto queryId = GetGpuCtx().ptr->NextQueryId();
|
||||||
glQueryCounter( GetGpuCtx().ptr->TranslateOpenGlQueryId( queryId ), GL_TIMESTAMP );
|
glQueryCounter( GetGpuCtx().ptr->TranslateOpenGlQueryId( queryId ), GL_TIMESTAMP );
|
||||||
|
|
||||||
|
#ifdef TRACY_FIBERS
|
||||||
|
TracyLfqPrepare( QueueType::GpuZoneBegin );
|
||||||
|
memset( &item->gpuZoneBegin.thread, 0, sizeof( item->gpuZoneBegin.thread ) );
|
||||||
|
#else
|
||||||
GetProfiler().SendCallstack( depth );
|
GetProfiler().SendCallstack( depth );
|
||||||
|
|
||||||
const auto thread = GetThreadHandle();
|
|
||||||
TracyLfqPrepare( QueueType::GpuZoneBeginCallstack );
|
TracyLfqPrepare( QueueType::GpuZoneBeginCallstack );
|
||||||
|
MemWrite( &item->gpuZoneBegin.thread, GetThreadHandle() );
|
||||||
|
#endif
|
||||||
MemWrite( &item->gpuZoneBegin.cpuTime, Profiler::GetTime() );
|
MemWrite( &item->gpuZoneBegin.cpuTime, Profiler::GetTime() );
|
||||||
MemWrite( &item->gpuZoneBegin.thread, thread );
|
|
||||||
MemWrite( &item->gpuZoneBegin.queryId, uint16_t( queryId ) );
|
MemWrite( &item->gpuZoneBegin.queryId, uint16_t( queryId ) );
|
||||||
MemWrite( &item->gpuZoneBegin.context, GetGpuCtx().ptr->GetId() );
|
MemWrite( &item->gpuZoneBegin.context, GetGpuCtx().ptr->GetId() );
|
||||||
MemWrite( &item->gpuZoneBegin.srcloc, (uint64_t)srcloc );
|
MemWrite( &item->gpuZoneBegin.srcloc, (uint64_t)srcloc );
|
||||||
@ -284,13 +287,16 @@ public:
|
|||||||
const auto queryId = GetGpuCtx().ptr->NextQueryId();
|
const auto queryId = GetGpuCtx().ptr->NextQueryId();
|
||||||
glQueryCounter( GetGpuCtx().ptr->TranslateOpenGlQueryId( queryId ), GL_TIMESTAMP );
|
glQueryCounter( GetGpuCtx().ptr->TranslateOpenGlQueryId( queryId ), GL_TIMESTAMP );
|
||||||
|
|
||||||
|
#ifdef TRACY_FIBERS
|
||||||
|
TracyLfqPrepare( QueueType::GpuZoneBeginAllocSrcLoc );
|
||||||
|
memset( &item->gpuZoneBegin.thread, 0, sizeof( item->gpuZoneBegin.thread ) );
|
||||||
|
#else
|
||||||
GetProfiler().SendCallstack( depth );
|
GetProfiler().SendCallstack( depth );
|
||||||
|
|
||||||
const auto thread = GetThreadHandle();
|
|
||||||
TracyLfqPrepare( QueueType::GpuZoneBeginAllocSrcLocCallstack );
|
TracyLfqPrepare( QueueType::GpuZoneBeginAllocSrcLocCallstack );
|
||||||
|
MemWrite( &item->gpuZoneBegin.thread, GetThreadHandle() );
|
||||||
|
#endif
|
||||||
const auto srcloc = Profiler::AllocSourceLocation( line, source, sourceSz, function, functionSz, name, nameSz );
|
const auto srcloc = Profiler::AllocSourceLocation( line, source, sourceSz, function, functionSz, name, nameSz );
|
||||||
MemWrite( &item->gpuZoneBegin.cpuTime, Profiler::GetTime() );
|
MemWrite( &item->gpuZoneBegin.cpuTime, Profiler::GetTime() );
|
||||||
MemWrite( &item->gpuZoneBegin.thread, thread );
|
|
||||||
MemWrite( &item->gpuZoneBegin.queryId, uint16_t( queryId ) );
|
MemWrite( &item->gpuZoneBegin.queryId, uint16_t( queryId ) );
|
||||||
MemWrite( &item->gpuZoneBegin.context, GetGpuCtx().ptr->GetId() );
|
MemWrite( &item->gpuZoneBegin.context, GetGpuCtx().ptr->GetId() );
|
||||||
MemWrite( &item->gpuZoneBegin.srcloc, (uint64_t)srcloc );
|
MemWrite( &item->gpuZoneBegin.srcloc, (uint64_t)srcloc );
|
||||||
|
Loading…
Reference in New Issue
Block a user