From 839cf6ef91dcae42059eec54c7fb892487d358da Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Mon, 6 May 2024 20:18:13 +0200 Subject: [PATCH] Add thread sorting. --- profiler/src/profiler/TracyView_Options.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/profiler/src/profiler/TracyView_Options.cpp b/profiler/src/profiler/TracyView_Options.cpp index 4f577062..0f56056c 100644 --- a/profiler/src/profiler/TracyView_Options.cpp +++ b/profiler/src/profiler/TracyView_Options.cpp @@ -599,6 +599,11 @@ void View::DrawOptions() m_tc.GetItem( t ).SetVisible( false ); } } + ImGui::SameLine(); + if( ImGui::SmallButton( "Sort" ) ) + { + std::sort( m_threadOrder.begin(), m_threadOrder.end(), [this] ( const auto& lhs, const auto& rhs ) { return strcmp( m_worker.GetThreadName( lhs->id ), m_worker.GetThreadName( rhs->id ) ) < 0; } ); + } const auto wposx = ImGui::GetCursorScreenPos().x; m_threadDnd.clear();