From 0f68e1e9816b7d9ab83bbbf2875e77687292b83a Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 23 Sep 2019 16:05:49 +0200 Subject: [PATCH] Send thread id in GPU zone end message. We don't care about OpenGL zone thread ids, so the identifier is zeroed. --- TracyOpenGL.hpp | 1 + TracyVulkan.hpp | 1 + common/TracyProtocol.hpp | 2 +- common/TracyQueue.hpp | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/TracyOpenGL.hpp b/TracyOpenGL.hpp index 8a69cb93..19adf2be 100644 --- a/TracyOpenGL.hpp +++ b/TracyOpenGL.hpp @@ -253,6 +253,7 @@ public: auto item = token->enqueue_begin( magic ); MemWrite( &item->hdr.type, QueueType::GpuZoneEnd ); MemWrite( &item->gpuZoneEnd.cpuTime, Profiler::GetTime() ); + memset( &item->gpuZoneEnd.thread, 0, sizeof( item->gpuZoneEnd.thread ) ); MemWrite( &item->gpuZoneEnd.queryId, uint16_t( queryId ) ); MemWrite( &item->gpuZoneEnd.context, GetGpuCtx().ptr->GetId() ); tail.store( magic + 1, std::memory_order_release ); diff --git a/TracyVulkan.hpp b/TracyVulkan.hpp index d95d8682..be87eb38 100644 --- a/TracyVulkan.hpp +++ b/TracyVulkan.hpp @@ -256,6 +256,7 @@ public: auto item = Profiler::QueueSerial(); MemWrite( &item->hdr.type, QueueType::GpuZoneEnd ); MemWrite( &item->gpuZoneEnd.cpuTime, Profiler::GetTime() ); + MemWrite( &item->gpuZoneEnd.thread, GetThreadHandle() ); MemWrite( &item->gpuZoneEnd.queryId, uint16_t( queryId ) ); MemWrite( &item->gpuZoneEnd.context, m_ctx->GetId() ); Profiler::QueueSerialFinish(); diff --git a/common/TracyProtocol.hpp b/common/TracyProtocol.hpp index 3cb30994..461cce39 100644 --- a/common/TracyProtocol.hpp +++ b/common/TracyProtocol.hpp @@ -9,7 +9,7 @@ namespace tracy { -enum : uint32_t { ProtocolVersion = 17 }; +enum : uint32_t { ProtocolVersion = 18 }; enum : uint32_t { BroadcastVersion = 0 }; using lz4sz_t = uint32_t; diff --git a/common/TracyQueue.hpp b/common/TracyQueue.hpp index e5dd784a..0622c632 100644 --- a/common/TracyQueue.hpp +++ b/common/TracyQueue.hpp @@ -237,6 +237,7 @@ struct QueueGpuZoneBegin struct QueueGpuZoneEnd { int64_t cpuTime; + uint64_t thread; uint16_t queryId; uint8_t context; };