mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +00:00
Simplify ZoneBegin functions
This commit is contained in:
parent
3f700c93a6
commit
d30a2d6854
@ -4291,20 +4291,16 @@ TRACY_API TracyCZoneCtx ___tracy_emit_zone_begin_callstack( const struct ___trac
|
|||||||
TracyQueueCommitC( zoneValidationThread );
|
TracyQueueCommitC( zoneValidationThread );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (depth > 0 && tracy::has_callstack()) {
|
auto zoneQueue = tracy::QueueType::ZoneBegin;
|
||||||
|
if( depth > 0 && tracy::has_callstack() ) {
|
||||||
tracy::GetProfiler().SendCallstack( depth );
|
tracy::GetProfiler().SendCallstack( depth );
|
||||||
{
|
zoneQueue = tracy::QueueType::ZoneBeginCallstack;
|
||||||
TracyQueuePrepareC( tracy::QueueType::ZoneBeginCallstack );
|
|
||||||
tracy::MemWrite( &item->zoneBegin.time, tracy::Profiler::GetTime() );
|
|
||||||
tracy::MemWrite( &item->zoneBegin.srcloc, (uint64_t)srcloc );
|
|
||||||
TracyQueueCommitC( zoneBeginThread );
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
TracyQueuePrepareC( tracy::QueueType::ZoneBegin );
|
|
||||||
tracy::MemWrite( &item->zoneBegin.time, tracy::Profiler::GetTime() );
|
|
||||||
tracy::MemWrite( &item->zoneBegin.srcloc, (uint64_t)srcloc );
|
|
||||||
TracyQueueCommitC( zoneBeginThread );
|
|
||||||
}
|
}
|
||||||
|
TracyQueuePrepareC( zoneQueue );
|
||||||
|
tracy::MemWrite( &item->zoneBegin.time, tracy::Profiler::GetTime() );
|
||||||
|
tracy::MemWrite( &item->zoneBegin.srcloc, (uint64_t)srcloc );
|
||||||
|
TracyQueueCommitC( zoneBeginThread );
|
||||||
|
|
||||||
return ctx;
|
return ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4363,20 +4359,16 @@ TRACY_API TracyCZoneCtx ___tracy_emit_zone_begin_alloc_callstack( uint64_t srclo
|
|||||||
TracyQueueCommitC( zoneValidationThread );
|
TracyQueueCommitC( zoneValidationThread );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (depth > 0 && tracy::has_callstack()) {
|
auto zoneQueue = tracy::QueueType::ZoneBeginAllocSrcLoc;
|
||||||
|
if( depth > 0 && tracy::has_callstack() ) {
|
||||||
tracy::GetProfiler().SendCallstack( depth );
|
tracy::GetProfiler().SendCallstack( depth );
|
||||||
{
|
zoneQueue = tracy::QueueType::ZoneBeginAllocSrcLocCallstack;
|
||||||
TracyQueuePrepareC( tracy::QueueType::ZoneBeginAllocSrcLocCallstack );
|
|
||||||
tracy::MemWrite( &item->zoneBegin.time, tracy::Profiler::GetTime() );
|
|
||||||
tracy::MemWrite( &item->zoneBegin.srcloc, srcloc );
|
|
||||||
TracyQueueCommitC( zoneBeginThread );
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
TracyQueuePrepareC( tracy::QueueType::ZoneBeginAllocSrcLoc );
|
|
||||||
tracy::MemWrite( &item->zoneBegin.time, tracy::Profiler::GetTime() );
|
|
||||||
tracy::MemWrite( &item->zoneBegin.srcloc, srcloc );
|
|
||||||
TracyQueueCommitC( zoneBeginThread );
|
|
||||||
}
|
}
|
||||||
|
TracyQueuePrepareC( zoneQueue );
|
||||||
|
tracy::MemWrite( &item->zoneBegin.time, tracy::Profiler::GetTime() );
|
||||||
|
tracy::MemWrite( &item->zoneBegin.srcloc, srcloc );
|
||||||
|
TracyQueueCommitC( zoneBeginThread );
|
||||||
|
|
||||||
return ctx;
|
return ctx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,19 +34,15 @@ public:
|
|||||||
#ifdef TRACY_ON_DEMAND
|
#ifdef TRACY_ON_DEMAND
|
||||||
m_connectionId = GetProfiler().ConnectionId();
|
m_connectionId = GetProfiler().ConnectionId();
|
||||||
#endif
|
#endif
|
||||||
if (depth > 0 && has_callstack()) {
|
auto zoneQueue = QueueType::ZoneBegin;
|
||||||
|
if( depth > 0 && has_callstack() ) {
|
||||||
GetProfiler().SendCallstack( depth );
|
GetProfiler().SendCallstack( depth );
|
||||||
|
zoneQueue = QueueType::ZoneBeginCallstack;
|
||||||
TracyQueuePrepare( QueueType::ZoneBeginCallstack );
|
|
||||||
MemWrite( &item->zoneBegin.time, Profiler::GetTime() );
|
|
||||||
MemWrite( &item->zoneBegin.srcloc, (uint64_t)srcloc );
|
|
||||||
TracyQueueCommit( zoneBeginThread );
|
|
||||||
} else {
|
|
||||||
TracyQueuePrepare( QueueType::ZoneBegin );
|
|
||||||
MemWrite( &item->zoneBegin.time, Profiler::GetTime() );
|
|
||||||
MemWrite( &item->zoneBegin.srcloc, (uint64_t)srcloc );
|
|
||||||
TracyQueueCommit( zoneBeginThread );
|
|
||||||
}
|
}
|
||||||
|
TracyQueuePrepare( zoneQueue );
|
||||||
|
MemWrite( &item->zoneBegin.time, Profiler::GetTime() );
|
||||||
|
MemWrite( &item->zoneBegin.srcloc, (uint64_t)srcloc );
|
||||||
|
TracyQueueCommit( zoneBeginThread );
|
||||||
}
|
}
|
||||||
|
|
||||||
tracy_force_inline ScopedZone( uint32_t line, const char* source, size_t sourceSz, const char* function, size_t functionSz, const char* name, size_t nameSz, uint32_t color, int depth = -1, bool is_active = true )
|
tracy_force_inline ScopedZone( uint32_t line, const char* source, size_t sourceSz, const char* function, size_t functionSz, const char* name, size_t nameSz, uint32_t color, int depth = -1, bool is_active = true )
|
||||||
@ -60,21 +56,16 @@ public:
|
|||||||
#ifdef TRACY_ON_DEMAND
|
#ifdef TRACY_ON_DEMAND
|
||||||
m_connectionId = GetProfiler().ConnectionId();
|
m_connectionId = GetProfiler().ConnectionId();
|
||||||
#endif
|
#endif
|
||||||
if (depth > 0 && has_callstack()) {
|
auto zoneQueue = QueueType::ZoneBeginAllocSrcLoc;
|
||||||
|
if( depth > 0 && has_callstack() ) {
|
||||||
GetProfiler().SendCallstack( depth );
|
GetProfiler().SendCallstack( depth );
|
||||||
|
zoneQueue = QueueType::ZoneBeginAllocSrcLocCallstack;
|
||||||
TracyQueuePrepare( QueueType::ZoneBeginAllocSrcLocCallstack );
|
|
||||||
const auto srcloc = Profiler::AllocSourceLocation( line, source, sourceSz, function, functionSz, name, nameSz, color );
|
|
||||||
MemWrite( &item->zoneBegin.time, Profiler::GetTime() );
|
|
||||||
MemWrite( &item->zoneBegin.srcloc, srcloc );
|
|
||||||
TracyQueueCommit( zoneBeginThread );
|
|
||||||
} else {
|
|
||||||
TracyQueuePrepare( QueueType::ZoneBeginAllocSrcLoc );
|
|
||||||
const auto srcloc = Profiler::AllocSourceLocation( line, source, sourceSz, function, functionSz, name, nameSz, color );
|
|
||||||
MemWrite( &item->zoneBegin.time, Profiler::GetTime() );
|
|
||||||
MemWrite( &item->zoneBegin.srcloc, srcloc );
|
|
||||||
TracyQueueCommit( zoneBeginThread );
|
|
||||||
}
|
}
|
||||||
|
TracyQueuePrepare( zoneQueue );
|
||||||
|
const auto srcloc = Profiler::AllocSourceLocation( line, source, sourceSz, function, functionSz, name, nameSz, color );
|
||||||
|
MemWrite( &item->zoneBegin.time, Profiler::GetTime() );
|
||||||
|
MemWrite( &item->zoneBegin.srcloc, srcloc );
|
||||||
|
TracyQueueCommit( zoneBeginThread );
|
||||||
}
|
}
|
||||||
|
|
||||||
tracy_force_inline ScopedZone( uint32_t line, const char* source, size_t sourceSz, const char* function, size_t functionSz, const char* name, size_t nameSz, int depth, bool is_active = true ) : ScopedZone( line, source, sourceSz, function, functionSz, name, nameSz, 0, depth, is_active ) {}
|
tracy_force_inline ScopedZone( uint32_t line, const char* source, size_t sourceSz, const char* function, size_t functionSz, const char* name, size_t nameSz, int depth, bool is_active = true ) : ScopedZone( line, source, sourceSz, function, functionSz, name, nameSz, 0, depth, is_active ) {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user