From c2b4e8149305b7466c2cdbc353597a3a683b1871 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 15 Oct 2024 02:22:52 +0200 Subject: [PATCH] Display omitted external frame counts. --- profiler/src/profiler/TracyView_Callstack.cpp | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/profiler/src/profiler/TracyView_Callstack.cpp b/profiler/src/profiler/TracyView_Callstack.cpp index f4ab8f74..f65f738f 100644 --- a/profiler/src/profiler/TracyView_Callstack.cpp +++ b/profiler/src/profiler/TracyView_Callstack.cpp @@ -152,7 +152,7 @@ void View::DrawCallstackTable( uint32_t callstack, bool globalEntriesButton ) ImGui::TableSetupColumn( "Image" ); ImGui::TableHeadersRow(); - bool external = false; + int external = 0; int fidx = 0; int bidx = 0; for( auto& entry : cs ) @@ -162,7 +162,7 @@ void View::DrawCallstackTable( uint32_t callstack, bool globalEntriesButton ) { if( !m_showExternalFrames ) { - external = true; + external++; continue; } ImGui::TableNextRow(); @@ -209,22 +209,29 @@ void View::DrawCallstackTable( uint32_t callstack, bool globalEntriesButton ) if( !m_showExternalFrames ) { if( f == fsz-1 ) fidx++; - external = true; + external++; continue; } } else { - if( external ) + if( external != 0 ) { ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGui::PushFont( m_smallFont ); TextDisabledUnformatted( "external" ); - ImGui::PopFont(); ImGui::TableNextColumn(); - TextDisabledUnformatted( "\xe2\x80\xa6" ); - external = false; + if( external == 1 ) + { + TextDisabledUnformatted( "1 frame" ); + } + else + { + ImGui::TextDisabled( "%i frames", external ); + } + ImGui::PopFont(); + external = 0; } } @@ -399,9 +406,16 @@ void View::DrawCallstackTable( uint32_t callstack, bool globalEntriesButton ) ImGui::TableNextColumn(); ImGui::PushFont( m_smallFont ); TextDisabledUnformatted( "external" ); - ImGui::PopFont(); ImGui::TableNextColumn(); - TextDisabledUnformatted( "\xe2\x80\xa6" ); + if( external == 1 ) + { + TextDisabledUnformatted( "1 frame" ); + } + else + { + ImGui::TextDisabled( "%i frames", external ); + } + ImGui::PopFont(); } ImGui::EndTable(); }