mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Send frame markers.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user