mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Allow retrieval of zone's thread data.
This commit is contained in:
parent
b4bfdb7872
commit
016f7ac4b6
@ -9824,7 +9824,7 @@ const GpuEvent* View::GetZoneParent( const GpuEvent& zone ) const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint64_t View::GetZoneThread( const ZoneEvent& zone ) const
|
||||
const ThreadData* View::GetZoneThreadData( const ZoneEvent& zone ) const
|
||||
{
|
||||
for( const auto& thread : m_worker.GetThreadData() )
|
||||
{
|
||||
@ -9835,12 +9835,18 @@ uint64_t View::GetZoneThread( const ZoneEvent& zone ) const
|
||||
auto it = std::upper_bound( timeline->begin(), timeline->end(), zone.start, [] ( const auto& l, const auto& r ) { return l < r->start; } );
|
||||
if( it != timeline->begin() ) --it;
|
||||
if( zone.end >= 0 && (*it)->start > zone.end ) break;
|
||||
if( *it == &zone ) return thread->id;
|
||||
if( *it == &zone ) return thread;
|
||||
if( (*it)->child < 0 ) break;
|
||||
timeline = &m_worker.GetZoneChildren( (*it)->child );
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint64_t View::GetZoneThread( const ZoneEvent& zone ) const
|
||||
{
|
||||
auto threadData = GetZoneThreadData( zone );
|
||||
return threadData ? threadData->id : 0;
|
||||
}
|
||||
|
||||
uint64_t View::GetZoneThread( const GpuEvent& zone ) const
|
||||
|
@ -162,6 +162,7 @@ private:
|
||||
|
||||
const ZoneEvent* GetZoneParent( const ZoneEvent& zone ) const;
|
||||
const GpuEvent* GetZoneParent( const GpuEvent& zone ) const;
|
||||
const ThreadData* GetZoneThreadData( const ZoneEvent& zone ) const;
|
||||
uint64_t GetZoneThread( const ZoneEvent& zone ) const;
|
||||
uint64_t GetZoneThread( const GpuEvent& zone ) const;
|
||||
const GpuCtxData* GetZoneCtx( const GpuEvent& zone ) const;
|
||||
|
Loading…
Reference in New Issue
Block a user