From ec884b2d60ecaa3e631b2c464a5278c34e99a500 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 5 Jul 2026 18:51:58 +0200 Subject: [PATCH] Allow setting time range limit from section. --- profiler/src/profiler/TracyView_Ranges.cpp | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/profiler/src/profiler/TracyView_Ranges.cpp b/profiler/src/profiler/TracyView_Ranges.cpp index 1e3b7537..87e85345 100644 --- a/profiler/src/profiler/TracyView_Ranges.cpp +++ b/profiler/src/profiler/TracyView_Ranges.cpp @@ -112,6 +112,29 @@ void View::DrawRangeEntry( Range& range, const char* label, uint32_t color, int ImGui::EndMenu(); } + auto& sections = m_worker.GetSections(); + if( sections.empty() ) + { + TextDisabledUnformatted( "Sections" ); + } + else if( ImGui::BeginMenu( "Sections" ) ) + { + int id = 0; + for( auto& v : sections ) + { + ImGui::PushID( id++ ); + if( ImGui::MenuItem( m_worker.GetString( v.text ) ) ) + { + range.min = v.start.Val(); + range.max = v.end.Val(); + } + ImGui::PopID(); + ImGui::SameLine(); + ImGui::TextDisabled( "%s - %s (%s)", TimeToStringExact( v.start.Val() ), TimeToStringExact( v.end.Val() ), TimeToString( v.end.Val() - v.start.Val() ) ); + } + ImGui::EndMenu(); + } + int idx = 0; for( auto& r : m_ranges ) {