mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Send frame markers.
This commit is contained in:
parent
90cdda8542
commit
03ece0ac48
@ -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();
|
||||
|
||||
|
@ -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" );
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user