From 18896044c40c427f4a67a41e831f339ee40e4d64 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 29 Jul 2018 16:56:46 +0200 Subject: [PATCH] Display explicit names of loaded things. --- server/TracyWorker.cpp | 16 ++++++++-------- server/TracyWorker.hpp | 12 ++++++++++++ standalone/src/main.cpp | 33 +++++++++++++++++++++++++++++++-- 3 files changed, 51 insertions(+), 10 deletions(-) diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index b8ca4cab..b0f6b87b 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -257,7 +257,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) } s_loadProgress.subTotal.store( 0, std::memory_order_relaxed ); - s_loadProgress.progress.store( 0, std::memory_order_relaxed ); + s_loadProgress.progress.store( LoadProgress::Initialization, std::memory_order_relaxed ); f.Read( m_resolution ); f.Read( m_timerMul ); f.Read( m_data.lastTime ); @@ -396,7 +396,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) } #endif - s_loadProgress.progress.store( 1, std::memory_order_relaxed ); + s_loadProgress.progress.store( LoadProgress::Locks, std::memory_order_relaxed ); f.Read( sz ); if( eventMask & EventType::Locks ) { @@ -498,7 +498,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) } s_loadProgress.subTotal.store( 0, std::memory_order_relaxed ); - s_loadProgress.progress.store( 2, std::memory_order_relaxed ); + s_loadProgress.progress.store( LoadProgress::Messages, std::memory_order_relaxed ); flat_hash_map> msgMap; f.Read( sz ); if( eventMask & EventType::Messages ) @@ -528,7 +528,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) } } - s_loadProgress.progress.store( 3, std::memory_order_relaxed ); + s_loadProgress.progress.store( LoadProgress::Zones, std::memory_order_relaxed ); f.Read( sz ); m_data.threads.reserve( sz ); for( uint64_t i=0; i total; diff --git a/standalone/src/main.cpp b/standalone/src/main.cpp index b74525d8..0b8f7d3c 100644 --- a/standalone/src/main.cpp +++ b/standalone/src/main.cpp @@ -197,10 +197,39 @@ int main( int argc, char** argv ) ImGui::CloseCurrentPopup(); totalProgress = currProgress; } - ImGui::Text( "Total progress: %" PRIu64 "/%" PRIu64, currProgress, totalProgress ); + switch( currProgress ) + { + case tracy::LoadProgress::Initialization: + ImGui::Text( "Initialization..." ); + break; + case tracy::LoadProgress::Locks: + ImGui::Text( "Locks..." ); + break; + case tracy::LoadProgress::Messages: + ImGui::Text( "Messages..." ); + break; + case tracy::LoadProgress::Zones: + ImGui::Text( "CPU zones..." ); + break; + case tracy::LoadProgress::GpuZones: + ImGui::Text( "GPU zones..." ); + break; + case tracy::LoadProgress::Plots: + ImGui::Text( "Plots..." ); + break; + case tracy::LoadProgress::Memory: + ImGui::Text( "Memory..." ); + break; + case tracy::LoadProgress::CallStacks: + ImGui::Text( "Call stacks..." ); + break; + default: + assert( false ); + break; + } ImGui::ProgressBar( float( currProgress ) / totalProgress, ImVec2( 200 * dpiScale, 0 ) ); - ImGui::Text( "Sub progress..." ); + ImGui::Text( "Progress..." ); auto subTotal = progress.subTotal.load( std::memory_order_relaxed ); auto subProgress = progress.subProgress.load( std::memory_order_relaxed ); if( subTotal == 0 )