Fix invalid tracy events from C# profiling api when profiler gets connected mid-event
This commit is contained in:
@@ -12,15 +12,16 @@
|
||||
|
||||
namespace tracy
|
||||
{
|
||||
void ScopedZone::Begin(const SourceLocationData* srcloc)
|
||||
bool ScopedZone::Begin(const SourceLocationData* srcloc)
|
||||
{
|
||||
#ifdef TRACY_ON_DEMAND
|
||||
if (!GetProfiler().IsConnected()) return;
|
||||
if (!GetProfiler().IsConnected()) return false;
|
||||
#endif
|
||||
TracyLfqPrepare( QueueType::ZoneBegin );
|
||||
MemWrite( &item->zoneBegin.time, Profiler::GetTime() );
|
||||
MemWrite( &item->zoneBegin.srcloc, (uint64_t)srcloc );
|
||||
TracyQueueCommit( zoneBeginThread );
|
||||
return true;
|
||||
}
|
||||
|
||||
void ScopedZone::End()
|
||||
|
||||
@@ -39,7 +39,7 @@ struct TRACY_API SourceLocationData
|
||||
class TRACY_API ScopedZone
|
||||
{
|
||||
public:
|
||||
static void Begin( const SourceLocationData* srcloc );
|
||||
static bool Begin( const SourceLocationData* srcloc );
|
||||
static void End();
|
||||
|
||||
ScopedZone( const ScopedZone& ) = delete;
|
||||
|
||||
Reference in New Issue
Block a user