diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 47aec8b2..2c5b3133 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -1510,28 +1510,60 @@ void View::DrawFrames() auto itEnd = std::lower_bound( itStart, zoneData.zones.end(), f1, [] ( const auto& l, const auto& r ) { return l.Zone()->Start() < r; } ); if( m_frames->continuous ) { - while( itStart != itEnd ) + if( m_findZone.selfTime ) { - const auto t0 = clamp( itStart->Zone()->Start(), f0, f1 ); - const auto t1 = clamp( m_worker.GetZoneEndDirect( *itStart->Zone() ), f0, f1 ); - zoneTime += t1 - t0; - itStart++; + while( itStart != itEnd ) + { + const auto t0 = clamp( itStart->Zone()->Start(), f0, f1 ); + const auto t1 = clamp( m_worker.GetZoneEndDirect( *itStart->Zone() ), f0, f1 ); + zoneTime += t1 - t0 - GetZoneChildTimeFastClamped( *itStart->Zone(), t0, t1 ); + itStart++; + } + } + else + { + while( itStart != itEnd ) + { + const auto t0 = clamp( itStart->Zone()->Start(), f0, f1 ); + const auto t1 = clamp( m_worker.GetZoneEndDirect( *itStart->Zone() ), f0, f1 ); + zoneTime += t1 - t0; + itStart++; + } } } else { - while( itStart != itEnd ) + if( m_findZone.selfTime ) { - const int g = std::min( group, total - ( m_vd.frameStart + idx ) ); - for( int j=0; jZone()->Start(), ft0, ft1 ); - const auto t1 = clamp( m_worker.GetZoneEndDirect( *itStart->Zone() ), ft0, ft1 ); - zoneTime += t1 - t0; + const int g = std::min( group, total - ( m_vd.frameStart + idx ) ); + for( int j=0; jZone()->Start(), ft0, ft1 ); + const auto t1 = clamp( m_worker.GetZoneEndDirect( *itStart->Zone() ), ft0, ft1 ); + zoneTime += t1 - t0 - GetZoneChildTimeFastClamped( *itStart->Zone(), t0, t1 ); + } + itStart++; + } + } + else + { + while( itStart != itEnd ) + { + const int g = std::min( group, total - ( m_vd.frameStart + idx ) ); + for( int j=0; jZone()->Start(), ft0, ft1 ); + const auto t1 = clamp( m_worker.GetZoneEndDirect( *itStart->Zone() ), ft0, ft1 ); + zoneTime += t1 - t0; + } + itStart++; } - itStart++; } } }