Parallelize timeline item preprocessing.

This commit is contained in:
Bartosz Taudul
2023-03-19 18:54:32 +01:00
parent 66d3c2a472
commit 1e1833edc2
5 changed files with 25 additions and 12 deletions

View File

@@ -277,20 +277,22 @@ void TimelineItemThread::DrawFinished()
m_draw.clear();
}
void TimelineItemThread::Preprocess( const TimelineContext& ctx )
void TimelineItemThread::Preprocess( const TimelineContext& ctx, TaskDispatch& td )
{
assert( m_draw.empty() );
td.Queue( [this, &ctx] {
#ifndef TRACY_NO_STATISTICS
if( m_worker.AreGhostZonesReady() && ( m_ghost || ( m_view.GetViewData().ghostZones && m_thread->timeline.empty() ) ) )
{
m_depth = PreprocessGhostLevel( ctx, m_thread->ghostZones, 0 );
}
else
if( m_worker.AreGhostZonesReady() && ( m_ghost || ( m_view.GetViewData().ghostZones && m_thread->timeline.empty() ) ) )
{
m_depth = PreprocessGhostLevel( ctx, m_thread->ghostZones, 0 );
}
else
#endif
{
m_depth = PreprocessZoneLevel( ctx, m_thread->timeline, 0 );
}
{
m_depth = PreprocessZoneLevel( ctx, m_thread->timeline, 0 );
}
} );
}
#ifndef TRACY_NO_STATISTICS