diff --git a/client/TracyProfiler.hpp b/client/TracyProfiler.hpp index 6e52093f..392945c5 100755 --- a/client/TracyProfiler.hpp +++ b/client/TracyProfiler.hpp @@ -70,17 +70,15 @@ public: #endif } - static tracy_force_inline QueueItem* StartItem( Magic& magic ) { return s_queue.enqueue_begin( s_token, magic ); } - static tracy_force_inline void FinishItem( Magic magic ) { s_queue.enqueue_finish( s_token, magic ); } - static tracy_force_inline void FrameMark() { int8_t cpu; Magic magic; - auto item = s_queue.enqueue_begin( s_token, magic ); + auto& token = s_token; + auto item = s_queue.enqueue_begin( token, magic ); item->hdr.type = QueueType::FrameMarkMsg; item->frameMark.time = GetTime( cpu ); - s_queue.enqueue_finish( s_token, magic ); + s_queue.enqueue_finish( token, magic ); } static bool ShouldExit(); diff --git a/client/TracyScoped.hpp b/client/TracyScoped.hpp index c03a8c75..58f4646d 100755 --- a/client/TracyScoped.hpp +++ b/client/TracyScoped.hpp @@ -18,22 +18,24 @@ public: const auto thread = GetThreadHandle(); m_thread = thread; Magic magic; - auto item = Profiler::StartItem( magic ); + auto& token = s_token; + auto item = s_queue.enqueue_begin( token, magic ); item->hdr.type = QueueType::ZoneBegin; item->zoneBegin.time = Profiler::GetTime( item->zoneBegin.cpu ); item->zoneBegin.thread = thread; item->zoneBegin.srcloc = (uint64_t)srcloc; - Profiler::FinishItem( magic ); + s_queue.enqueue_finish( token, magic ); } tracy_force_inline ~ScopedZone() { Magic magic; - auto item = Profiler::StartItem( magic ); + auto& token = s_token; + auto item = s_queue.enqueue_begin( token, magic ); item->hdr.type = QueueType::ZoneEnd; item->zoneEnd.time = Profiler::GetTime( item->zoneEnd.cpu ); item->zoneEnd.thread = m_thread; - Profiler::FinishItem( magic ); + s_queue.enqueue_finish( token, magic ); } tracy_force_inline void Text( const char* txt, size_t size ) @@ -42,21 +44,23 @@ public: auto ptr = new char[size+1]; memcpy( ptr, txt, size ); ptr[size] = '\0'; - auto item = Profiler::StartItem( magic ); + auto& token = s_token; + auto item = s_queue.enqueue_begin( token, magic ); item->hdr.type = QueueType::ZoneText; item->zoneText.thread = m_thread; item->zoneText.text = (uint64_t)ptr; - Profiler::FinishItem( magic ); + s_queue.enqueue_finish( token, magic ); } tracy_force_inline void Name( const char* name ) { Magic magic; - auto item = Profiler::StartItem( magic ); + auto& token = s_token; + auto item = s_queue.enqueue_begin( token, magic ); item->hdr.type = QueueType::ZoneName; item->zoneName.thread = m_thread; item->zoneName.name = (uint64_t)name; - Profiler::FinishItem( magic ); + s_queue.enqueue_finish( token, magic ); } private: