From f06609eb6172ea7fa6f052be523d2f346c9ab0e8 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 14 Feb 2019 01:28:12 +0100 Subject: [PATCH] GPU child zones time getter. --- server/TracyView.cpp | 14 ++++++++++++++ server/TracyView.hpp | 1 + 2 files changed, 15 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index ba508f3f..02b6c450 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -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; diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 3ba13051..f76c6565 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -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> m_visible;