mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +00:00
Separate uarch data retrieval from tooltip display.
This commit is contained in:
parent
abd00e28b8
commit
adc60bf394
@ -1765,12 +1765,8 @@ void SourceView::RenderAsmLine( const AsmLine& line, uint32_t ipcnt, uint32_t ip
|
|||||||
ImGui::SameLine( 0, ty );
|
ImGui::SameLine( 0, ty );
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto msz = line.mnemonic.size();
|
const AsmVar* asmVar = nullptr;
|
||||||
memcpy( buf, line.mnemonic.c_str(), msz );
|
if( ( m_cpuArch == CpuArchX64 || m_cpuArch == CpuArchX86 ) )
|
||||||
memset( buf+msz, ' ', m_maxMnemonicLen-msz );
|
|
||||||
memcpy( buf+m_maxMnemonicLen, line.operands.c_str(), line.operands.size() + 1 );
|
|
||||||
ImGui::TextUnformatted( buf );
|
|
||||||
if( ( m_cpuArch == CpuArchX64 || m_cpuArch == CpuArchX86 ) && ImGui::IsItemHovered() )
|
|
||||||
{
|
{
|
||||||
auto uarch = MicroArchitectureData[m_idxMicroArch];
|
auto uarch = MicroArchitectureData[m_idxMicroArch];
|
||||||
char tmp[32];
|
char tmp[32];
|
||||||
@ -1822,7 +1818,21 @@ void SourceView::RenderAsmLine( const AsmLine& line, uint32_t ipcnt, uint32_t ip
|
|||||||
if( !res.empty() )
|
if( !res.empty() )
|
||||||
{
|
{
|
||||||
pdqsort_branchless( res.begin(), res.end(), []( const auto& l, const auto& r ) { return l.second < r.second; } );
|
pdqsort_branchless( res.begin(), res.end(), []( const auto& l, const auto& r ) { return l.second < r.second; } );
|
||||||
const auto& var = *op->variant[res[0].first];
|
asmVar = op->variant[res[0].first];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const auto msz = line.mnemonic.size();
|
||||||
|
memcpy( buf, line.mnemonic.c_str(), msz );
|
||||||
|
memset( buf+msz, ' ', m_maxMnemonicLen-msz );
|
||||||
|
memcpy( buf+m_maxMnemonicLen, line.operands.c_str(), line.operands.size() + 1 );
|
||||||
|
ImGui::TextUnformatted( buf );
|
||||||
|
|
||||||
|
if( asmVar && ImGui::IsItemHovered() )
|
||||||
|
{
|
||||||
|
const auto& var = *asmVar;
|
||||||
if( m_font ) ImGui::PopFont();
|
if( m_font ) ImGui::PopFont();
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
TextFocused( "Throughput:", RealToString( var.tp ) );
|
TextFocused( "Throughput:", RealToString( var.tp ) );
|
||||||
@ -1919,9 +1929,6 @@ void SourceView::RenderAsmLine( const AsmLine& line, uint32_t ipcnt, uint32_t ip
|
|||||||
ImGui::EndTooltip();
|
ImGui::EndTooltip();
|
||||||
if( m_font ) ImGui::PushFont( m_font );
|
if( m_font ) ImGui::PushFont( m_font );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if( line.jumpAddr != 0 )
|
if( line.jumpAddr != 0 )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user