Rearrange trace information window.

This commit is contained in:
Bartosz Taudul 2019-07-12 19:12:04 +02:00
parent 5a4c7518ed
commit fc28f827bc

View File

@ -8317,9 +8317,6 @@ void View::DrawInfo()
ImGui::SetNextWindowSize( ImVec2( 400, 650 ), ImGuiCond_FirstUseEver );
ImGui::Begin( "Trace information", &m_showInfo );
TextFocused( "Profiler memory usage:", MemSizeToString( memUsage.load( std::memory_order_relaxed ) ) );
TextFocused( "Profiler FPS:", RealToString( int( io.Framerate ), true ) );
ImGui::Separator();
TextFocused( "Captured program:", m_worker.GetCaptureProgram().c_str() );
TextFocused( "Capture time:", dtmp );
ImGui::TextDisabled( "Trace version:" );
@ -8327,6 +8324,17 @@ void View::DrawInfo()
const auto version = m_worker.GetTraceVersion();
ImGui::Text( "%i.%i.%i", version >> 16, ( version >> 8 ) & 0xFF, version & 0xFF );
ImGui::Separator();
if( ImGui::TreeNode( "Profiler statistics" ) )
{
TextFocused( "Profiler memory usage:", MemSizeToString( memUsage.load( std::memory_order_relaxed ) ) );
TextFocused( "Profiler FPS:", RealToString( int( io.Framerate ), true ) );
ImGui::TreePop();
}
const auto ficnt = m_worker.GetFrameImageCount();
if( ImGui::TreeNode( "Trace statistics" ) )
{
TextFocused( "Queue delay:", TimeToString( m_worker.GetDelay() ) );
TextFocused( "Timer resolution:", TimeToString( m_worker.GetResolution() ) );
ImGui::Separator();
@ -8337,20 +8345,12 @@ void View::DrawInfo()
TextFocused( "Source locations:", RealToString( m_worker.GetSrcLocCount(), true ) );
TextFocused( "Call stacks:", RealToString( m_worker.GetCallstackPayloadCount(), true ) );
TextFocused( "Call stack frames:", RealToString( m_worker.GetCallstackFrameCount(), true ) );
const auto ficnt = m_worker.GetFrameImageCount();
TextFocused( "Frame images:", RealToString( ficnt, true ) );
if( ficnt != 0 )
{
#ifdef TRACY_EXTENDED_FONT
if( ImGui::Button( ICON_FA_PLAY " Playback" ) )
#else
if( ImGui::Button( "Playback" ) )
#endif
{
m_showPlayback = true;
}
ImGui::TreePop();
}
if( ImGui::TreeNode( "Frame statistics" ) )
{
const auto fsz = m_worker.GetFullFrameCount( *m_frames );
if( fsz != 0 )
{
@ -8472,7 +8472,7 @@ void View::DrawInfo()
ImGui::EndTooltip();
}
if( ImGui::TreeNode( "Histogram" ) )
if( ImGui::TreeNodeEx( "Histogram", ImGuiTreeNodeFlags_DefaultOpen ) )
{
const auto ty = ImGui::GetFontSize();
@ -8843,8 +8843,36 @@ void View::DrawInfo()
ImGui::TreePop();
}
}
ImGui::TreePop();
}
if( ficnt != 0 )
{
ImGui::Separator();
#ifdef TRACY_EXTENDED_FONT
if( ImGui::Button( ICON_FA_PLAY " Playback" ) )
#else
if( ImGui::Button( "Playback" ) )
#endif
{
m_showPlayback = true;
}
}
ImGui::Separator();
TextFocused( "Host info:", m_worker.GetHostInfo().c_str() );
auto& appInfo = m_worker.GetAppInfo();
if( !appInfo.empty() )
{
ImGui::Separator();
TextDisabledUnformatted( "Application info:" );
for( auto& v : appInfo )
{
ImGui::TextUnformatted( m_worker.GetString( v ) );
}
}
auto& crash = m_worker.GetCrashEvent();
if( crash.thread != 0 )
{
@ -8896,17 +8924,6 @@ void View::DrawInfo()
}
}
auto& appInfo = m_worker.GetAppInfo();
if( !appInfo.empty() )
{
ImGui::Separator();
TextDisabledUnformatted( "Application info:" );
for( auto& v : appInfo )
{
ImGui::TextUnformatted( m_worker.GetString( v ) );
}
}
ImGui::End();
}