diff --git a/TracyOpenGL.hpp b/TracyOpenGL.hpp index 8df50ba6..58b17ba0 100644 --- a/TracyOpenGL.hpp +++ b/TracyOpenGL.hpp @@ -15,6 +15,7 @@ #else #include +#include #include #include "Tracy.hpp" @@ -39,7 +40,7 @@ namespace tracy { -extern std::atomic s_gpuCtxCounter; +extern std::atomic s_gpuCtxCounter; class GpuCtx { @@ -53,6 +54,8 @@ public: , m_head( 0 ) , m_tail( 0 ) { + assert( m_context != 255 ); + glGenQueries( QueryCount, m_query ); int64_t tgpu; @@ -142,13 +145,13 @@ private: return m_query[id]; } - tracy_force_inline uint16_t GetId() const + tracy_force_inline uint8_t GetId() const { return m_context; } unsigned int m_query[QueryCount]; - uint16_t m_context; + uint8_t m_context; unsigned int m_head; unsigned int m_tail; diff --git a/TracyVulkan.hpp b/TracyVulkan.hpp index e307ee3f..8ea81237 100644 --- a/TracyVulkan.hpp +++ b/TracyVulkan.hpp @@ -13,6 +13,7 @@ #else +#include #include #include #include "Tracy.hpp" @@ -36,7 +37,7 @@ namespace tracy { -extern std::atomic s_gpuCtxCounter; +extern std::atomic s_gpuCtxCounter; class VkCtx { @@ -53,6 +54,8 @@ public: , m_tail( 0 ) , m_oldCnt( 0 ) { + assert( m_context != 255 ); + VkPhysicalDeviceProperties prop; vkGetPhysicalDeviceProperties( physdev, &prop ); const float period = prop.limits.timestampPeriod; @@ -167,7 +170,7 @@ private: return id; } - tracy_force_inline uint16_t GetId() const + tracy_force_inline uint8_t GetId() const { return m_context; } @@ -175,7 +178,7 @@ private: VkDevice m_device; VkQueue m_queue; VkQueryPool m_query; - uint16_t m_context; + uint8_t m_context; unsigned int m_head; unsigned int m_tail; diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index bc64b886..f1c4fd8d 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -169,7 +169,7 @@ static InitTimeWrapper init_order(101) s_initTime { SetupHwTimer() }; static RPMallocInit init_order(102) s_rpmalloc_init; moodycamel::ConcurrentQueue init_order(103) s_queue( QueuePrealloc ); std::atomic init_order(104) s_lockCounter( 0 ); -std::atomic init_order(104) s_gpuCtxCounter( 0 ); +std::atomic init_order(104) s_gpuCtxCounter( 0 ); thread_local GpuCtxWrapper init_order(104) s_gpuCtx { nullptr }; VkCtxWrapper init_order(104) s_vkCtx { nullptr }; diff --git a/common/TracyQueue.hpp b/common/TracyQueue.hpp index 54889766..52b7f2b9 100644 --- a/common/TracyQueue.hpp +++ b/common/TracyQueue.hpp @@ -168,7 +168,7 @@ struct QueueGpuNewContext int64_t gpuTime; uint64_t thread; float period; - uint16_t context; + uint8_t context; uint8_t accuracyBits; }; @@ -177,26 +177,26 @@ struct QueueGpuZoneBegin int64_t cpuTime; uint64_t srcloc; uint64_t thread; - uint16_t context; + uint8_t context; }; struct QueueGpuZoneEnd { int64_t cpuTime; - uint16_t context; + uint8_t context; }; struct QueueGpuTime { int64_t gpuTime; - uint16_t context; + uint8_t context; }; struct QueueGpuResync { int64_t cpuTime; int64_t gpuTime; - uint16_t context; + uint8_t context; }; struct QueueMemAlloc diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index 368b2e70..37bf188c 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -322,7 +322,7 @@ private: char* m_buffer; int m_bufferOffset; - flat_hash_map> m_gpuCtxMap; + flat_hash_map> m_gpuCtxMap; flat_hash_map> m_pendingCustomStrings; flat_hash_map> m_pendingPlots; flat_hash_map m_pendingCallstacks;