diff --git a/client/Tracy.hpp b/client/Tracy.hpp index 4dbbe9b1..ee5fd7b4 100755 --- a/client/Tracy.hpp +++ b/client/Tracy.hpp @@ -1,8 +1,10 @@ #ifndef __TRACY_HPP__ #define __TRACY_HPP__ +#include "TracyProfiler.hpp" #include "TracyScoped.hpp" #define ZoneScoped tracy::ScopedZone ___tracy_scoped_zone( __FILE__, __FUNCTION__, __LINE__ ); +#define FrameMark tracy::Profiler::FrameMark(); #endif diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index 6dd3009c..b13b0e07 100755 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -75,6 +75,14 @@ void Profiler::ZoneEnd( uint64_t id, QueueZoneEnd&& data ) s_instance->m_queue.enqueue( GetToken(), std::move( item ) ); } +void Profiler::FrameMark() +{ + QueueItem item; + item.hdr.type = QueueType::FrameMark; + item.hdr.id = (uint64_t)GetTime(); + s_instance->m_queue.enqueue( GetToken(), std::move( item ) ); +} + Profiler* Profiler::Instance() { return s_instance; diff --git a/client/TracyProfiler.hpp b/client/TracyProfiler.hpp index 9a238af4..ed4f207f 100755 --- a/client/TracyProfiler.hpp +++ b/client/TracyProfiler.hpp @@ -29,6 +29,7 @@ public: static uint64_t ZoneBegin( QueueZoneBegin&& data ); static void ZoneEnd( uint64_t id, QueueZoneEnd&& data ); + static void FrameMark(); static bool ShouldExit(); diff --git a/common/TracyQueue.hpp b/common/TracyQueue.hpp index 0eb5e73c..4a7c71c9 100755 --- a/common/TracyQueue.hpp +++ b/common/TracyQueue.hpp @@ -11,6 +11,7 @@ enum class QueueType : uint8_t ZoneBegin, ZoneEnd, StringData, + FrameMark, NUM_TYPES }; @@ -57,6 +58,7 @@ static const size_t QueueDataSize[] = { sizeof( QueueHeader ) + sizeof( QueueZoneBegin ), sizeof( QueueHeader ) + sizeof( QueueZoneEnd ), sizeof( QueueHeader ), + sizeof( QueueHeader ), }; static_assert( sizeof( QueueDataSize ) / sizeof( size_t ) == (uint8_t)QueueType::NUM_TYPES, "QueueDataSize mismatch" ); diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 9c5e4a29..45177e75 100755 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -168,6 +168,8 @@ void View::Process( const QueueItem& ev ) case QueueType::ZoneEnd: ProcessZoneEnd( ev.hdr.id, ev.zoneEnd ); break; + case QueueType::FrameMark: + break; default: assert( false ); break;