From 7bb61142705eac64dd974ecca4c2ce82650c0215 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 31 Jan 2021 18:56:03 +0100 Subject: [PATCH] Process GPU context name messages. --- server/TracyEvent.hpp | 1 + server/TracyWorker.cpp | 11 +++++++++++ server/TracyWorker.hpp | 1 + 3 files changed, 13 insertions(+) diff --git a/server/TracyEvent.hpp b/server/TracyEvent.hpp index 047ccf8b..e46333a9 100644 --- a/server/TracyEvent.hpp +++ b/server/TracyEvent.hpp @@ -580,6 +580,7 @@ struct GpuCtxData int64_t calibratedGpuTime; int64_t calibratedCpuTime; double calibrationMod; + StringIdx name; unordered_flat_map threadData; short_ptr query[64*1024]; }; diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 616dd851..644f6a96 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -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; diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index 88baaaf6..3028df54 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -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 );