Process GPU context name messages.

This commit is contained in:
Bartosz Taudul 2021-01-31 18:56:03 +01:00
parent cd4114f264
commit 7bb6114270
3 changed files with 13 additions and 0 deletions

View File

@ -580,6 +580,7 @@ struct GpuCtxData
int64_t calibratedGpuTime;
int64_t calibratedCpuTime;
double calibrationMod;
StringIdx name;
unordered_flat_map<uint64_t, GpuCtxThreadData> threadData;
short_ptr<GpuEvent> query[64*1024];
};

View File

@ -4259,6 +4259,9 @@ bool Worker::Process( const QueueItem& ev )
case QueueType::GpuCalibration:
ProcessGpuCalibration( ev.gpuCalibration );
break;
case QueueType::GpuContextName:
ProcessGpuContextName( ev.gpuContextName );
break;
case QueueType::MemAlloc:
ProcessMemAlloc( ev.memAlloc );
break;
@ -5448,6 +5451,14 @@ void Worker::ProcessGpuCalibration( const QueueGpuCalibration& ev )
ctx->calibratedCpuTime = TscTime( ev.cpuTime - m_data.baseTime );
}
void Worker::ProcessGpuContextName( const QueueGpuContextName& ev )
{
auto ctx = m_gpuCtxMap[ev.context];
assert( ctx );
const auto idx = GetSingleStringIdx();
ctx->name = StringIdx( idx );
}
MemEvent* Worker::ProcessMemAllocImpl( uint64_t memname, MemData& memdata, const QueueMemAlloc& ev )
{
const auto refTime = m_refTimeSerial + ev.time;

View File

@ -642,6 +642,7 @@ private:
tracy_force_inline void ProcessGpuZoneEnd( const QueueGpuZoneEnd& ev, bool serial );
tracy_force_inline void ProcessGpuTime( const QueueGpuTime& ev );
tracy_force_inline void ProcessGpuCalibration( const QueueGpuCalibration& ev );
tracy_force_inline void ProcessGpuContextName( const QueueGpuContextName& ev );
tracy_force_inline MemEvent* ProcessMemAlloc( const QueueMemAlloc& ev );
tracy_force_inline MemEvent* ProcessMemAllocNamed( const QueueMemAlloc& ev );
tracy_force_inline MemEvent* ProcessMemFree( const QueueMemFree& ev );