From 1dd117533e848ebb19e54fa038f1cbe8c776205f Mon Sep 17 00:00:00 2001 From: Terence Rokop Date: Sat, 26 Jun 2021 10:36:46 -0700 Subject: [PATCH] Avoid non-reentrant option in sampling/symbol view --- server/TracyView.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 858b9ac0..8950de86 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -12275,8 +12275,12 @@ void View::AccumulationModeComboBox() { ImGui::TextUnformatted( "Accumulation mode" ); ImGui::SameLine(); - const char* accumulationModeTable = "Self only\0Including children\0Non-reentrant\0"; + const char* accumulationModeTable = m_statMode == 0 ? "Self only\0Including children\0Non-reentrant\0" : "Self only\0Including children\0"; ImGui::SetNextItemWidth( ImGui::CalcTextSize( "Including children" ).x + ImGui::GetTextLineHeight() * 2 ); + if ( m_statMode != 0 && m_statAccumulationMode == AccumulationMode::NonReentrantChildren ) + { + m_statAccumulationMode = AccumulationMode::SelfOnly; + } int accumulationMode = static_cast( m_statAccumulationMode ); ImGui::Combo( "##accumulationMode", &accumulationMode, accumulationModeTable ); m_statAccumulationMode = static_cast( accumulationMode );