mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Move child zones into an expandable tree.
This commit is contained in:
parent
4d38ebe1b1
commit
f6d4728494
@ -2466,43 +2466,49 @@ void View::DrawZoneInfoWindow()
|
|||||||
|
|
||||||
if( !ev.child.empty() )
|
if( !ev.child.empty() )
|
||||||
{
|
{
|
||||||
const auto ty = ImGui::GetTextLineHeight();
|
|
||||||
ImGui::Columns( 2 );
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
ImGui::Text( "Child zones: %s", RealToString( ev.child.size(), true ) );
|
bool expand = ImGui::TreeNodeEx( "Child zones", ImGuiTreeNodeFlags_DefaultOpen );
|
||||||
ImGui::NextColumn();
|
ImGui::SameLine();
|
||||||
char buf[128];
|
ImGui::TextDisabled( "(%s)", RealToString( ev.child.size(), true ) );
|
||||||
sprintf( buf, "Exclusive time: %s (%.2f%%)", TimeToString( ztime - ctime ), double( ztime - ctime ) / ztime * 100 );
|
if( expand )
|
||||||
ImGui::ProgressBar( double( ztime - ctime ) / ztime, ImVec2( -1, ty ), buf );
|
|
||||||
ImGui::NextColumn();
|
|
||||||
ImGui::Separator();
|
|
||||||
for( size_t i=0; i<ev.child.size(); i++ )
|
|
||||||
{
|
{
|
||||||
auto& cev = *ev.child[cti[i]];
|
const auto ty = ImGui::GetTextLineHeight();
|
||||||
const auto& csl = m_worker.GetSourceLocation( cev.srcloc );
|
ImGui::Columns( 2 );
|
||||||
const auto txt = csl.name.active ? m_worker.GetString( csl.name ) : m_worker.GetString( csl.function );
|
ImGui::TextColored( ImVec4( 1.0f, 1.0f, 0.4f, 1.0f ), "Exclusive time" );
|
||||||
bool b = false;
|
|
||||||
if( ImGui::Selectable( txt, &b, ImGuiSelectableFlags_SpanAllColumns ) )
|
|
||||||
{
|
|
||||||
m_zoneInfoWindow = &cev;
|
|
||||||
}
|
|
||||||
if( ImGui::IsItemHovered() )
|
|
||||||
{
|
|
||||||
m_zoneHighlight = &cev;
|
|
||||||
if( ImGui::IsMouseClicked( 2 ) )
|
|
||||||
{
|
|
||||||
ZoomToZone( cev );
|
|
||||||
}
|
|
||||||
ZoneTooltip( cev );
|
|
||||||
}
|
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
const auto part = double( ctt[cti[i]] ) / ztime;
|
|
||||||
char buf[128];
|
char buf[128];
|
||||||
sprintf( buf, "%s (%.2f%%)", TimeToString( ctt[cti[i]] ), part * 100 );
|
sprintf( buf, "%s (%.2f%%)", TimeToString( ztime - ctime ), double( ztime - ctime ) / ztime * 100 );
|
||||||
ImGui::ProgressBar( part, ImVec2( -1, ty ), buf );
|
ImGui::ProgressBar( double( ztime - ctime ) / ztime, ImVec2( -1, ty ), buf );
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
|
for( size_t i=0; i<ev.child.size(); i++ )
|
||||||
|
{
|
||||||
|
auto& cev = *ev.child[cti[i]];
|
||||||
|
const auto& csl = m_worker.GetSourceLocation( cev.srcloc );
|
||||||
|
const auto txt = csl.name.active ? m_worker.GetString( csl.name ) : m_worker.GetString( csl.function );
|
||||||
|
bool b = false;
|
||||||
|
if( ImGui::Selectable( txt, &b, ImGuiSelectableFlags_SpanAllColumns ) )
|
||||||
|
{
|
||||||
|
m_zoneInfoWindow = &cev;
|
||||||
|
}
|
||||||
|
if( ImGui::IsItemHovered() )
|
||||||
|
{
|
||||||
|
m_zoneHighlight = &cev;
|
||||||
|
if( ImGui::IsMouseClicked( 2 ) )
|
||||||
|
{
|
||||||
|
ZoomToZone( cev );
|
||||||
|
}
|
||||||
|
ZoneTooltip( cev );
|
||||||
|
}
|
||||||
|
ImGui::NextColumn();
|
||||||
|
const auto part = double( ctt[cti[i]] ) / ztime;
|
||||||
|
char buf[128];
|
||||||
|
sprintf( buf, "%s (%.2f%%)", TimeToString( ctt[cti[i]] ), part * 100 );
|
||||||
|
ImGui::ProgressBar( part, ImVec2( -1, ty ), buf );
|
||||||
|
ImGui::NextColumn();
|
||||||
|
}
|
||||||
|
ImGui::EndColumns();
|
||||||
|
ImGui::TreePop();
|
||||||
}
|
}
|
||||||
ImGui::EndColumns();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
@ -2573,42 +2579,48 @@ void View::DrawGpuInfoWindow()
|
|||||||
|
|
||||||
if( !ev.child.empty() )
|
if( !ev.child.empty() )
|
||||||
{
|
{
|
||||||
const auto ty = ImGui::GetTextLineHeight();
|
|
||||||
ImGui::Columns( 2 );
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
ImGui::Text( "Child zones: %s", RealToString( ev.child.size(), true ) );
|
bool expand = ImGui::TreeNodeEx( "Child zones", ImGuiTreeNodeFlags_DefaultOpen );
|
||||||
ImGui::NextColumn();
|
ImGui::SameLine();
|
||||||
char buf[128];
|
ImGui::TextDisabled( "(%s)", RealToString( ev.child.size(), true ) );
|
||||||
sprintf( buf, "Exclusive time: %s (%.2f%%)", TimeToString( ztime - ctime ), double( ztime - ctime ) / ztime * 100 );
|
if( expand )
|
||||||
ImGui::ProgressBar( double( ztime - ctime ) / ztime, ImVec2( -1, ty ), buf );
|
|
||||||
ImGui::NextColumn();
|
|
||||||
ImGui::Separator();
|
|
||||||
for( size_t i=0; i<ev.child.size(); i++ )
|
|
||||||
{
|
{
|
||||||
auto& cev = *ev.child[cti[i]];
|
const auto ty = ImGui::GetTextLineHeight();
|
||||||
const auto& csl = m_worker.GetSourceLocation( cev.srcloc );
|
ImGui::Columns( 2 );
|
||||||
bool b = false;
|
ImGui::TextColored( ImVec4( 1.0f, 1.0f, 0.4f, 1.0f ), "Exclusive time" );
|
||||||
if( ImGui::Selectable( m_worker.GetString( csl.name ), &b, ImGuiSelectableFlags_SpanAllColumns ) )
|
|
||||||
{
|
|
||||||
m_gpuInfoWindow = &cev;
|
|
||||||
}
|
|
||||||
if( ImGui::IsItemHovered() )
|
|
||||||
{
|
|
||||||
m_gpuHighlight = &cev;
|
|
||||||
if( ImGui::IsMouseClicked( 2 ) )
|
|
||||||
{
|
|
||||||
ZoomToZone( cev );
|
|
||||||
}
|
|
||||||
ZoneTooltip( cev );
|
|
||||||
}
|
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
const auto part = double( ctt[cti[i]] ) / ztime;
|
|
||||||
char buf[128];
|
char buf[128];
|
||||||
sprintf( buf, "%s (%.2f%%)", TimeToString( ctt[cti[i]] ), part * 100 );
|
sprintf( buf, "%s (%.2f%%)", TimeToString( ztime - ctime ), double( ztime - ctime ) / ztime * 100 );
|
||||||
ImGui::ProgressBar( part, ImVec2( -1, ty ), buf );
|
ImGui::ProgressBar( double( ztime - ctime ) / ztime, ImVec2( -1, ty ), buf );
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
|
for( size_t i=0; i<ev.child.size(); i++ )
|
||||||
|
{
|
||||||
|
auto& cev = *ev.child[cti[i]];
|
||||||
|
const auto& csl = m_worker.GetSourceLocation( cev.srcloc );
|
||||||
|
bool b = false;
|
||||||
|
if( ImGui::Selectable( m_worker.GetString( csl.name ), &b, ImGuiSelectableFlags_SpanAllColumns ) )
|
||||||
|
{
|
||||||
|
m_gpuInfoWindow = &cev;
|
||||||
|
}
|
||||||
|
if( ImGui::IsItemHovered() )
|
||||||
|
{
|
||||||
|
m_gpuHighlight = &cev;
|
||||||
|
if( ImGui::IsMouseClicked( 2 ) )
|
||||||
|
{
|
||||||
|
ZoomToZone( cev );
|
||||||
|
}
|
||||||
|
ZoneTooltip( cev );
|
||||||
|
}
|
||||||
|
ImGui::NextColumn();
|
||||||
|
const auto part = double( ctt[cti[i]] ) / ztime;
|
||||||
|
char buf[128];
|
||||||
|
sprintf( buf, "%s (%.2f%%)", TimeToString( ctt[cti[i]] ), part * 100 );
|
||||||
|
ImGui::ProgressBar( part, ImVec2( -1, ty ), buf );
|
||||||
|
ImGui::NextColumn();
|
||||||
|
}
|
||||||
|
ImGui::EndColumns();
|
||||||
|
ImGui::TreePop();
|
||||||
}
|
}
|
||||||
ImGui::EndColumns();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user