From 748c22df8e98b6d1762675a56aa5de2497269614 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 19 Jun 2021 20:11:53 +0200 Subject: [PATCH] Darken assembly instructions which aren't in current context. --- server/TracySourceView.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/server/TracySourceView.cpp b/server/TracySourceView.cpp index df87174b..638acfe7 100644 --- a/server/TracySourceView.cpp +++ b/server/TracySourceView.cpp @@ -3363,9 +3363,10 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr memcpy( buf+m_maxMnemonicLen, line.operands.c_str(), line.operands.size() + 1 ); } + const bool isInContext = !m_calcInlineStats || !worker.HasInlineSymbolAddresses() || worker.GetInlineSymbolForAddress( line.addr ) == m_symAddr; if( asmIdx == m_asmSelected ) { - TextColoredUnformatted( ImVec4( 1, 0.25f, 0.25f, 1 ), buf ); + TextColoredUnformatted( ImVec4( 1, 0.25f, 0.25f, isInContext ? 1.f : 0.5f ), buf ); } else if( line.regData[0] != 0 ) { @@ -3383,16 +3384,30 @@ void SourceView::RenderAsmLine( AsmLine& line, const AddrStat& ipcnt, const Addr } if( hasDepencency ) { - TextColoredUnformatted( ImVec4( 1, 0.5f, 1, 1 ), buf ); + TextColoredUnformatted( ImVec4( 1, 0.5f, 1, isInContext ? 1.f : 0.5f ), buf ); } else { - ImGui::TextUnformatted( buf ); + if( isInContext ) + { + ImGui::TextUnformatted( buf ); + } + else + { + TextDisabledUnformatted( buf ); + } } } else { - ImGui::TextUnformatted( buf ); + if( isInContext ) + { + ImGui::TextUnformatted( buf ); + } + else + { + TextDisabledUnformatted( buf ); + } } uint32_t jumpOffset;