diff --git a/TracyOpenGL.hpp b/TracyOpenGL.hpp index 7690cd48..ae0d59ed 100644 --- a/TracyOpenGL.hpp +++ b/TracyOpenGL.hpp @@ -117,6 +117,7 @@ public: auto item = token->enqueue_begin( magic ); MemWrite( &item->hdr.type, QueueType::GpuTime ); MemWrite( &item->gpuTime.gpuTime, (int64_t)time ); + MemWrite( &item->gpuTime.queryId, (uint16_t)m_tail ); MemWrite( &item->gpuTime.context, m_context ); tail.store( magic + 1, std::memory_order_release ); m_tail = ( m_tail + 1 ) % QueryCount; diff --git a/TracyVulkan.hpp b/TracyVulkan.hpp index 8bb5f5f8..161e5bc9 100644 --- a/TracyVulkan.hpp +++ b/TracyVulkan.hpp @@ -149,6 +149,7 @@ public: auto item = token->enqueue_begin( magic ); MemWrite( &item->hdr.type, QueueType::GpuTime ); MemWrite( &item->gpuTime.gpuTime, res[idx] ); + MemWrite( &item->gpuTime.queryId, uint16_t( m_tail + idx ) ); MemWrite( &item->gpuTime.context, m_context ); tail.store( magic + 1, std::memory_order_release ); } @@ -185,7 +186,6 @@ private: extern VkCtxWrapper s_vkCtx; -// TODO: not thread safe! class VkCtxScope { public: diff --git a/common/TracyQueue.hpp b/common/TracyQueue.hpp index 504e0870..0f257a85 100644 --- a/common/TracyQueue.hpp +++ b/common/TracyQueue.hpp @@ -191,6 +191,7 @@ struct QueueGpuZoneEnd struct QueueGpuTime { int64_t gpuTime; + uint16_t queryId; uint8_t context; };