mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 16:04:34 +00:00
Add sub progress display.
This commit is contained in:
parent
3a401106b0
commit
a14238c199
@ -253,6 +253,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask )
|
||||
s_loadProgress.total.store( 8, std::memory_order_relaxed );
|
||||
}
|
||||
|
||||
s_loadProgress.subTotal.store( 0, std::memory_order_relaxed );
|
||||
s_loadProgress.progress.store( 0, std::memory_order_relaxed );
|
||||
f.Read( m_resolution );
|
||||
f.Read( m_timerMul );
|
||||
|
@ -49,6 +49,8 @@ struct LoadProgress
|
||||
{
|
||||
std::atomic<uint64_t> total = 0;
|
||||
std::atomic<uint64_t> progress = 0;
|
||||
std::atomic<uint64_t> subTotal = 0;
|
||||
std::atomic<uint64_t> subProgress = 0;
|
||||
};
|
||||
|
||||
class Worker
|
||||
|
@ -192,6 +192,19 @@ int main( int argc, char** argv )
|
||||
}
|
||||
ImGui::Text( "Total progress: %" PRIu64 "/%" PRIu64, currProgress, totalProgress );
|
||||
ImGui::ProgressBar( float( currProgress ) / totalProgress, ImVec2( 200 * dpiScale, 0 ) );
|
||||
|
||||
auto subTotal = progress.subTotal.load( std::memory_order_relaxed );
|
||||
auto subProgress = progress.subProgress.load( std::memory_order_relaxed );
|
||||
if( subTotal == 0 )
|
||||
{
|
||||
ImGui::Text( "Sub progress..." );
|
||||
ImGui::ProgressBar( 1.f, ImVec2( 200 * dpiScale, 0 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::Text( "Sub progress: %" PRIu64 "/%" PRIu64, subProgress, subTotal );
|
||||
ImGui::ProgressBar( float( subProgress ) / subTotal, ImVec2( 200 * dpiScale, 0 ) );
|
||||
}
|
||||
ImGui::EndPopup();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user