From c25169072264863be61db2e7a64457f374b74616 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 17 Nov 2017 14:07:42 +0100 Subject: [PATCH] Query OpenGL time stamp accuracy. --- TracyOpenGL.hpp | 4 ++++ common/TracyQueue.hpp | 1 + 2 files changed, 5 insertions(+) diff --git a/TracyOpenGL.hpp b/TracyOpenGL.hpp index 243dfe72..0b129d27 100644 --- a/TracyOpenGL.hpp +++ b/TracyOpenGL.hpp @@ -58,6 +58,9 @@ public: glGetInteger64v( GL_TIMESTAMP, &tgpu ); int64_t tcpu = Profiler::GetTime(); + GLint bits; + glGetQueryiv( GL_TIMESTAMP, GL_QUERY_COUNTER_BITS, &bits ); + Magic magic; auto& token = s_token.ptr; auto& tail = token->get_tail_index(); @@ -67,6 +70,7 @@ public: item->gpuNewContext.gputime = tgpu; item->gpuNewContext.thread = GetThreadHandle(); item->gpuNewContext.context = m_context; + item->gpuNewContext.accuracyBits = bits; tail.store( magic + 1, std::memory_order_release ); } diff --git a/common/TracyQueue.hpp b/common/TracyQueue.hpp index f37da22b..46523e63 100644 --- a/common/TracyQueue.hpp +++ b/common/TracyQueue.hpp @@ -140,6 +140,7 @@ struct QueueGpuNewContext int64_t gputime; uint64_t thread; uint16_t context; + uint8_t accuracyBits; }; struct QueueGpuZoneBegin