mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-30 01:04:36 +00:00
Add serial functions
This commit is contained in:
parent
2995db4b5e
commit
2db109ab98
6
TracyC.h
6
TracyC.h
@ -158,6 +158,12 @@ TRACY_API void ___tracy_emit_gpu_time( const struct ___tracy_gpu_time_data );
|
||||
TRACY_API void ___tracy_emit_gpu_new_context( const struct ___tracy_gpu_new_context_data );
|
||||
TRACY_API void ___tracy_emit_gpu_context_name( const struct ___tracy_gpu_context_name_data );
|
||||
|
||||
TRACY_API void ___tracy_emit_gpu_zone_begin_alloc_serial( const struct ___tracy_gpu_zone_begin_data );
|
||||
TRACY_API void ___tracy_emit_gpu_zone_end_serial( const struct ___tracy_gpu_zone_end_data data );
|
||||
TRACY_API void ___tracy_emit_gpu_time_serial( const struct ___tracy_gpu_time_data );
|
||||
TRACY_API void ___tracy_emit_gpu_new_context_serial( const struct ___tracy_gpu_new_context_data );
|
||||
TRACY_API void ___tracy_emit_gpu_context_name_serial( const struct ___tracy_gpu_context_name_data );
|
||||
|
||||
#if defined TRACY_HAS_CALLSTACK && defined TRACY_CALLSTACK
|
||||
# define TracyCZone( ctx, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __func__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
|
||||
# define TracyCZoneN( ctx, name, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __func__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
|
||||
|
@ -3995,7 +3995,6 @@ TRACY_API void ___tracy_emit_gpu_zone_end( const struct ___tracy_gpu_zone_end_da
|
||||
TracyLfqCommitC;
|
||||
}
|
||||
|
||||
|
||||
TRACY_API void ___tracy_emit_gpu_new_context( ___tracy_gpu_new_context_data data )
|
||||
{
|
||||
TracyLfqPrepareC( tracy::QueueType::GpuNewContext );
|
||||
@ -4021,6 +4020,66 @@ TRACY_API void ___tracy_emit_gpu_context_name( const struct ___tracy_gpu_context
|
||||
TracyLfqCommitC;
|
||||
}
|
||||
|
||||
TRACY_API void ___tracy_emit_gpu_zone_begin_alloc_serial( const struct ___tracy_gpu_zone_begin_data data )
|
||||
{
|
||||
auto item = tracy::Profiler::QueueSerial();
|
||||
tracy::MemWrite( &item->hdr.type, tracy::QueueType::GpuZoneBeginAllocSrcLocSerial );
|
||||
tracy::MemWrite( &item->gpuZoneBegin.cpuTime, tracy::Profiler::GetTime() );
|
||||
tracy::MemWrite( &item->gpuNewContext.thread, tracy::GetThreadHandle() );
|
||||
tracy::MemWrite( &item->gpuZoneBegin.srcloc, data.srcloc );
|
||||
tracy::MemWrite( &item->gpuZoneBegin.queryId, data.queryId );
|
||||
tracy::MemWrite( &item->gpuZoneBegin.context, data.context );
|
||||
tracy::Profiler::QueueSerialFinish();
|
||||
}
|
||||
|
||||
TRACY_API void ___tracy_emit_gpu_time_serial( const struct ___tracy_gpu_time_data data )
|
||||
{
|
||||
auto item = tracy::Profiler::QueueSerial();
|
||||
tracy::MemWrite( &item->hdr.type, tracy::QueueType::GpuTime );
|
||||
tracy::MemWrite( &item->gpuTime.gpuTime, data.gpuTime );
|
||||
tracy::MemWrite( &item->gpuTime.queryId, data.queryId );
|
||||
tracy::MemWrite( &item->gpuTime.context, data.context );
|
||||
tracy::Profiler::QueueSerialFinish();
|
||||
}
|
||||
|
||||
TRACY_API void ___tracy_emit_gpu_zone_end_serial( const struct ___tracy_gpu_zone_end_data data )
|
||||
{
|
||||
auto item = tracy::Profiler::QueueSerial();
|
||||
tracy::MemWrite( &item->hdr.type, tracy::QueueType::GpuZoneEndSerial );
|
||||
tracy::MemWrite( &item->gpuZoneEnd.cpuTime, tracy::Profiler::GetTime() );
|
||||
memset( &item->gpuZoneEnd.thread, 0, sizeof( item->gpuZoneEnd.thread ) );
|
||||
tracy::MemWrite( &item->gpuZoneEnd.queryId, data.queryId );
|
||||
tracy::MemWrite( &item->gpuZoneEnd.context, data.context );
|
||||
tracy::Profiler::QueueSerialFinish();
|
||||
}
|
||||
|
||||
TRACY_API void ___tracy_emit_gpu_new_context_serial( ___tracy_gpu_new_context_data data )
|
||||
{
|
||||
auto item = tracy::Profiler::QueueSerial();
|
||||
tracy::MemWrite( &item->hdr.type, tracy::QueueType::GpuNewContext );
|
||||
tracy::MemWrite( &item->gpuNewContext.cpuTime, tracy::Profiler::GetTime() );
|
||||
tracy::MemWrite( &item->gpuNewContext.thread, tracy::GetThreadHandle() );
|
||||
tracy::MemWrite( &item->gpuNewContext.gpuTime, data.gpuTime );
|
||||
tracy::MemWrite( &item->gpuNewContext.period, data.period );
|
||||
tracy::MemWrite( &item->gpuNewContext.context, data.context );
|
||||
tracy::MemWrite( &item->gpuNewContext.flags, data.flags );
|
||||
tracy::MemWrite( &item->gpuNewContext.type, data.type );
|
||||
tracy::Profiler::QueueSerialFinish();
|
||||
}
|
||||
|
||||
TRACY_API void ___tracy_emit_gpu_context_name_serial( const struct ___tracy_gpu_context_name_data data )
|
||||
{
|
||||
auto ptr = (char*)tracy::tracy_malloc( data.len );
|
||||
memcpy( ptr, data.name, data.len );
|
||||
|
||||
auto item = tracy::Profiler::QueueSerial();
|
||||
tracy::MemWrite( &item->hdr.type, tracy::QueueType::GpuContextName );
|
||||
tracy::MemWrite( &item->gpuContextNameFat.context, data.context );
|
||||
tracy::MemWrite( &item->gpuContextNameFat.ptr, (uint64_t)ptr );
|
||||
tracy::MemWrite( &item->gpuContextNameFat.size, data.len );
|
||||
tracy::Profiler::QueueSerialFinish();
|
||||
}
|
||||
|
||||
# ifdef TRACY_MANUAL_LIFETIME
|
||||
TRACY_API void ___tracy_startup_profiler( void )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user