From 43d5ab4382ec1fb1605abca6d5549d10bdb6573a Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 10 Jul 2018 22:26:40 +0200 Subject: [PATCH] Count frames in on-demand mode. --- client/TracyProfiler.cpp | 1 + client/TracyProfiler.hpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 37687134..fd36123f 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -200,6 +200,7 @@ Profiler::Profiler() , m_serialDequeue( 1024*1024 ) #ifdef TRACY_ON_DEMAND , m_isConnected( false ) + , m_frameCount( 0 ) #endif { assert( !s_instance ); diff --git a/client/TracyProfiler.hpp b/client/TracyProfiler.hpp index f833d5a7..65c534a2 100644 --- a/client/TracyProfiler.hpp +++ b/client/TracyProfiler.hpp @@ -119,6 +119,7 @@ public: static tracy_force_inline void FrameMark() { #ifdef TRACY_ON_DEMAND + s_profiler.m_frameCount.fetch_add( 1, std::memory_order_relaxed ); if( !s_profiler.IsConnected() ) return; #endif Magic magic; @@ -389,6 +390,7 @@ private: #ifdef TRACY_ON_DEMAND std::atomic m_isConnected; + std::atomic m_frameCount; #endif };