Show loading progress of frame images.

This commit is contained in:
Bartosz Taudul 2019-06-06 23:40:37 +02:00
parent f8a4909c96
commit 646e7327b8
3 changed files with 15 additions and 2 deletions

View File

@ -446,6 +446,9 @@ int main( int argc, char** argv )
case tracy::LoadProgress::CallStacks:
ImGui::TextUnformatted( "Call stacks..." );
break;
case tracy::LoadProgress::FrameImages:
ImGui::TextUnformatted( "Frame images..." );
break;
default:
assert( false );
break;

View File

@ -296,10 +296,14 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
{
s_loadProgress.total.store( 7, std::memory_order_relaxed );
}
else
else if( fileVer <= FileVersion( 0, 4, 8 ) )
{
s_loadProgress.total.store( 8, std::memory_order_relaxed );
}
else
{
s_loadProgress.total.store( 9, std::memory_order_relaxed );
}
s_loadProgress.subTotal.store( 0, std::memory_order_relaxed );
s_loadProgress.progress.store( LoadProgress::Initialization, std::memory_order_relaxed );
@ -1231,12 +1235,17 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
if( fileVer >= FileVersion( 0, 4, 9 ) )
{
s_loadProgress.subTotal.store( 0, std::memory_order_relaxed );
s_loadProgress.progress.store( LoadProgress::FrameImages, std::memory_order_relaxed );
if( eventMask & EventType::FrameImages )
{
f.Read( sz );
m_data.frameImage.reserve_exact( sz, m_slab );
s_loadProgress.subTotal.store( sz, std::memory_order_relaxed );
for( uint64_t i=0; i<sz; i++ )
{
s_loadProgress.subProgress.store( i, std::memory_order_relaxed );
auto fi = m_slab.Alloc<FrameImage>();
f.Read2( fi->w, fi->h );
const auto sz = fi->w * fi->h * 4;

View File

@ -58,7 +58,8 @@ struct LoadProgress
GpuZones,
Plots,
Memory,
CallStacks
CallStacks,
FrameImages
};
LoadProgress() : total( 0 ), progress( 0 ), subTotal( 0 ), subProgress( 0 ) {}