GPU child zones time getter.

This commit is contained in:
Bartosz Taudul 2019-02-14 01:28:12 +01:00
parent 92c1420c30
commit f06609eb61
2 changed files with 15 additions and 0 deletions

View File

@ -9064,6 +9064,20 @@ int64_t View::GetZoneChildTime( const ZoneEvent& zone )
return time;
}
int64_t View::GetZoneChildTime( const GpuEvent& zone )
{
int64_t time = 0;
if( zone.child >= 0 )
{
for( auto& v : m_worker.GetGpuChildren( zone.child ) )
{
const auto childSpan = std::max( int64_t( 0 ), v->gpuEnd - v->gpuStart );
time += childSpan;
}
}
return time;
}
int64_t View::GetZoneChildTimeFast( const ZoneEvent& zone )
{
int64_t time = 0;

View File

@ -170,6 +170,7 @@ private:
void SmallCallstackButton( const char* name, uint32_t callstack, int& idx );
void SetViewToLastFrames();
int64_t GetZoneChildTime( const ZoneEvent& zone );
int64_t GetZoneChildTime( const GpuEvent& zone );
int64_t GetZoneChildTimeFast( const ZoneEvent& zone );
flat_hash_map<const void*, bool, nohash<const void*>> m_visible;