mirror of
https://github.com/wolfpld/tracy.git
synced 2026-09-09 20:08:12 +00:00
Defer GPU context events in serial C API
Without this, the profiler crashes due to an assert violation when connecting to a client built with TRACY_ON_DEMAND that uses these C API calls.
This commit is contained in:
@@ -4798,6 +4798,11 @@ TRACY_API void ___tracy_emit_gpu_new_context_serial( ___tracy_gpu_new_context_da
|
||||
tracy::MemWrite( &item->gpuNewContext.context, data.context );
|
||||
tracy::MemWrite( &item->gpuNewContext.flags, data.flags );
|
||||
tracy::MemWrite( &item->gpuNewContext.type, data.type );
|
||||
|
||||
#ifdef TRACY_ON_DEMAND
|
||||
tracy::GetProfiler().DeferItem( *item );
|
||||
#endif
|
||||
|
||||
tracy::Profiler::QueueSerialFinish();
|
||||
}
|
||||
|
||||
@@ -4811,6 +4816,11 @@ TRACY_API void ___tracy_emit_gpu_context_name_serial( const struct ___tracy_gpu_
|
||||
tracy::MemWrite( &item->gpuContextNameFat.context, data.context );
|
||||
tracy::MemWrite( &item->gpuContextNameFat.ptr, (uint64_t)ptr );
|
||||
tracy::MemWrite( &item->gpuContextNameFat.size, data.len );
|
||||
|
||||
#ifdef TRACY_ON_DEMAND
|
||||
tracy::GetProfiler().DeferItem( *item );
|
||||
#endif
|
||||
|
||||
tracy::Profiler::QueueSerialFinish();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user