From 63184f876274d4402f18fd5b1c82b0da916abf32 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 24 Sep 2019 00:55:24 +0200 Subject: [PATCH] Better Vulkan thread heuristics. --- server/TracyView.cpp | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 2a9b29bb..9b274fbe 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -2132,15 +2132,33 @@ void View::DrawZones() { if( !v->threadData.empty() ) { - ImGui::TextDisabled( "Threads:" ); - ImGui::Indent(); - for( auto& td : v->threadData ) + if( v->threadData.size() == 1 ) { - ImGui::TextUnformatted( m_worker.GetThreadName( td.first ) ); + auto it = v->threadData.begin(); + auto tid = it->first; + if( tid == 0 ) + { + if( !it->second.timeline.empty() ) + { + tid = m_worker.DecompressThread( (*it->second.timeline.begin())->thread ); + } + } + TextFocused( "Thread:", m_worker.GetThreadName( tid ) ); ImGui::SameLine(); - ImGui::TextDisabled( "(%s)", RealToString( td.first, true ) ); + ImGui::TextDisabled( "(%s)", RealToString( tid, true ) ); + } + else + { + ImGui::TextDisabled( "Threads:" ); + ImGui::Indent(); + for( auto& td : v->threadData ) + { + ImGui::TextUnformatted( m_worker.GetThreadName( td.first ) ); + ImGui::SameLine(); + ImGui::TextDisabled( "(%s)", RealToString( td.first, true ) ); + } + ImGui::Unindent(); } - ImGui::Unindent(); } } if( !v->threadData.empty() )