mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-30 01:04:36 +00:00
Don't retrieve connection id, if zone is not active.
This commit is contained in:
parent
ced2d52043
commit
885fa16373
@ -18,12 +18,14 @@ public:
|
|||||||
tracy_force_inline ScopedZone( const SourceLocationData* srcloc, bool is_active = true )
|
tracy_force_inline ScopedZone( const SourceLocationData* srcloc, bool is_active = true )
|
||||||
#ifdef TRACY_ON_DEMAND
|
#ifdef TRACY_ON_DEMAND
|
||||||
: m_active( is_active && GetProfiler().IsConnected() )
|
: m_active( is_active && GetProfiler().IsConnected() )
|
||||||
, m_connectionId( GetProfiler().ConnectionId() )
|
|
||||||
#else
|
#else
|
||||||
: m_active( is_active )
|
: m_active( is_active )
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if( !m_active ) return;
|
if( !m_active ) return;
|
||||||
|
#ifdef TRACY_ON_DEMAND
|
||||||
|
m_connectionId = GetProfiler().ConnectionId();
|
||||||
|
#endif
|
||||||
TracyLfqPrepare( QueueType::ZoneBegin );
|
TracyLfqPrepare( QueueType::ZoneBegin );
|
||||||
MemWrite( &item->zoneBegin.time, Profiler::GetTime() );
|
MemWrite( &item->zoneBegin.time, Profiler::GetTime() );
|
||||||
MemWrite( &item->zoneBegin.srcloc, (uint64_t)srcloc );
|
MemWrite( &item->zoneBegin.srcloc, (uint64_t)srcloc );
|
||||||
@ -33,12 +35,14 @@ public:
|
|||||||
tracy_force_inline ScopedZone( const SourceLocationData* srcloc, int depth, bool is_active = true )
|
tracy_force_inline ScopedZone( const SourceLocationData* srcloc, int depth, bool is_active = true )
|
||||||
#ifdef TRACY_ON_DEMAND
|
#ifdef TRACY_ON_DEMAND
|
||||||
: m_active( is_active && GetProfiler().IsConnected() )
|
: m_active( is_active && GetProfiler().IsConnected() )
|
||||||
, m_connectionId( GetProfiler().ConnectionId() )
|
|
||||||
#else
|
#else
|
||||||
: m_active( is_active )
|
: m_active( is_active )
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if( !m_active ) return;
|
if( !m_active ) return;
|
||||||
|
#ifdef TRACY_ON_DEMAND
|
||||||
|
m_connectionId = GetProfiler().ConnectionId();
|
||||||
|
#endif
|
||||||
TracyLfqPrepare( QueueType::ZoneBeginCallstack );
|
TracyLfqPrepare( QueueType::ZoneBeginCallstack );
|
||||||
MemWrite( &item->zoneBegin.time, Profiler::GetTime() );
|
MemWrite( &item->zoneBegin.time, Profiler::GetTime() );
|
||||||
MemWrite( &item->zoneBegin.srcloc, (uint64_t)srcloc );
|
MemWrite( &item->zoneBegin.srcloc, (uint64_t)srcloc );
|
||||||
|
Loading…
Reference in New Issue
Block a user