mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-30 01:04:36 +00:00
GPU zone thread getter.
This commit is contained in:
parent
5a32cd7984
commit
0f6ec65b65
@ -3542,6 +3542,25 @@ uint64_t View::GetZoneThread( const ZoneEvent& zone ) const
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64_t View::GetZoneThread( const GpuEvent& zone ) const
|
||||
{
|
||||
for( const auto& ctx : m_worker.GetGpuData() )
|
||||
{
|
||||
const Vector<GpuEvent*>* timeline = &ctx->timeline;
|
||||
if( timeline->empty() ) continue;
|
||||
for(;;)
|
||||
{
|
||||
auto it = std::upper_bound( timeline->begin(), timeline->end(), zone.gpuStart, [] ( const auto& l, const auto& r ) { return l < r->gpuStart; } );
|
||||
if( it != timeline->begin() ) --it;
|
||||
if( zone.gpuEnd != -1 && (*it)->gpuStart > zone.gpuEnd ) break;
|
||||
if( *it == &zone ) return ctx->thread;
|
||||
if( (*it)->child.empty() ) break;
|
||||
timeline = &(*it)->child;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef TRACY_NO_STATISTICS
|
||||
void View::FindZones()
|
||||
{
|
||||
|
@ -97,6 +97,7 @@ private:
|
||||
const ZoneEvent* GetZoneParent( const ZoneEvent& zone ) const;
|
||||
const GpuEvent* GetZoneParent( const GpuEvent& zone ) const;
|
||||
uint64_t GetZoneThread( const ZoneEvent& zone ) const;
|
||||
uint64_t GetZoneThread( const GpuEvent& zone ) const;
|
||||
|
||||
#ifndef TRACY_NO_STATISTICS
|
||||
void FindZones();
|
||||
|
Loading…
Reference in New Issue
Block a user