diff --git a/TracyOpenGL.hpp b/TracyOpenGL.hpp index e9f0169f..89e8a120 100644 --- a/TracyOpenGL.hpp +++ b/TracyOpenGL.hpp @@ -50,6 +50,7 @@ public: GLint bits; glGetQueryiv( GL_TIMESTAMP, GL_QUERY_COUNTER_BITS, &bits ); + const float period = 1.f; Magic magic; auto& token = s_token.ptr; auto& tail = token->get_tail_index(); @@ -58,6 +59,7 @@ public: MemWrite( &item->gpuNewContext.cpuTime, tcpu ); MemWrite( &item->gpuNewContext.gpuTime, tgpu ); MemWrite( &item->gpuNewContext.thread, GetThreadHandle() ); + MemWrite( &item->gpuNewContext.period, period ); MemWrite( &item->gpuNewContext.context, m_context ); MemWrite( &item->gpuNewContext.accuracyBits, (uint8_t)bits ); tail.store( magic + 1, std::memory_order_release ); diff --git a/TracyVulkan.hpp b/TracyVulkan.hpp index db5d7a8f..34e8d894 100644 --- a/TracyVulkan.hpp +++ b/TracyVulkan.hpp @@ -42,7 +42,7 @@ public: { VkPhysicalDeviceProperties prop; vkGetPhysicalDeviceProperties( physdev, &prop ); - m_period = prop.limits.timestampPeriod; + const float period = prop.limits.timestampPeriod; VkQueryPoolCreateInfo poolInfo = {}; poolInfo.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO; @@ -89,6 +89,7 @@ public: MemWrite( &item->gpuNewContext.cpuTime, tcpu ); MemWrite( &item->gpuNewContext.gpuTime, tgpu ); MemWrite( &item->gpuNewContext.thread, GetThreadHandle() ); + MemWrite( &item->gpuNewContext.period, period ); MemWrite( &item->gpuNewContext.context, m_context ); MemWrite( &item->gpuNewContext.accuracyBits, uint8_t( 0 ) ); tail.store( magic + 1, std::memory_order_release ); @@ -149,7 +150,6 @@ private: VkQueue m_queue; VkQueryPool m_query; uint16_t m_context; - float m_period; unsigned int m_head; unsigned int m_tail; diff --git a/common/TracyQueue.hpp b/common/TracyQueue.hpp index 69c0f6b6..45e80590 100644 --- a/common/TracyQueue.hpp +++ b/common/TracyQueue.hpp @@ -159,6 +159,7 @@ struct QueueGpuNewContext int64_t cpuTime; int64_t gpuTime; uint64_t thread; + float period; uint16_t context; uint8_t accuracyBits; };