mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Correctly calculate discontinuous frames time.
This commit is contained in:
parent
aac0a36a2d
commit
a0814a2e5c
@ -1275,6 +1275,8 @@ void View::DrawFrames()
|
||||
if( itStart != zoneData.zones.end() )
|
||||
{
|
||||
auto itEnd = std::lower_bound( itStart, zoneData.zones.end(), f1, [this] ( const auto& l, const auto& r ) { return l.Zone()->Start() < r; } );
|
||||
if( m_frames->continuous )
|
||||
{
|
||||
while( itStart != itEnd )
|
||||
{
|
||||
const auto t0 = clamp( itStart->Zone()->Start(), f0, f1 );
|
||||
@ -1284,6 +1286,23 @@ void View::DrawFrames()
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
while( itStart != itEnd )
|
||||
{
|
||||
const int g = std::min( group, total - ( m_vd.frameStart + idx ) );
|
||||
for( int j=0; j<g; j++ )
|
||||
{
|
||||
const auto ft0 = m_worker.GetFrameBegin( *m_frames, m_vd.frameStart + idx + j );
|
||||
const auto ft1 = m_worker.GetFrameEnd( *m_frames, m_vd.frameStart + idx + j );
|
||||
const auto t0 = clamp( itStart->Zone()->Start(), ft0, ft1 );
|
||||
const auto t1 = clamp( m_worker.GetZoneEndDirect( *itStart->Zone() ), ft0, ft1 );
|
||||
zoneTime += t1 - t0;
|
||||
}
|
||||
itStart++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
begin = itStart;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user