mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 06:44:35 +00:00
Merge pull request #243 from benvanik/patch-4
Indenting empty GPU zone tree nodes when grouped to keep zones aligned.
This commit is contained in:
commit
50f7deb1a3
@ -7929,7 +7929,9 @@ void View::DrawZoneInfoChildren( const V& children, int64_t ztime )
|
|||||||
pdqsort_branchless( cgvec.begin(), cgvec.end(), []( const auto& lhs, const auto& rhs ) { return lhs->t > rhs->t; } );
|
pdqsort_branchless( cgvec.begin(), cgvec.end(), []( const auto& lhs, const auto& rhs ) { return lhs->t > rhs->t; } );
|
||||||
|
|
||||||
ImGui::Columns( 2 );
|
ImGui::Columns( 2 );
|
||||||
|
ImGui::Indent( ImGui::GetTreeNodeToLabelSpacing() * 2 );
|
||||||
TextColoredUnformatted( ImVec4( 1.0f, 1.0f, 0.4f, 1.0f ), "Self time" );
|
TextColoredUnformatted( ImVec4( 1.0f, 1.0f, 0.4f, 1.0f ), "Self time" );
|
||||||
|
ImGui::Unindent( ImGui::GetTreeNodeToLabelSpacing() * 2 );
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
char buf[128];
|
char buf[128];
|
||||||
PrintStringPercent( buf, TimeToString( ztime - ctime ), double( ztime - ctime ) / ztime * 100 );
|
PrintStringPercent( buf, TimeToString( ztime - ctime ), double( ztime - ctime ) / ztime * 100 );
|
||||||
@ -7945,11 +7947,11 @@ void View::DrawZoneInfoChildren( const V& children, int64_t ztime )
|
|||||||
{
|
{
|
||||||
auto& cev = a(children[cgr.v.front()]);
|
auto& cev = a(children[cgr.v.front()]);
|
||||||
const auto txt = m_worker.GetZoneName( cev );
|
const auto txt = m_worker.GetZoneName( cev );
|
||||||
bool b = false;
|
|
||||||
SmallColorBox( GetSrcLocColor( srcloc, 0 ) );
|
SmallColorBox( GetSrcLocColor( srcloc, 0 ) );
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::PushID( (int)cgr.v.front() );
|
ImGui::PushID( (int)cgr.v.front() );
|
||||||
if( ImGui::Selectable( txt, &b, ImGuiSelectableFlags_SpanAllColumns ) )
|
ImGui::TreeNodeEx( txt, ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen );
|
||||||
|
if( ImGui::IsItemClicked() )
|
||||||
{
|
{
|
||||||
ShowZoneInfo( cev );
|
ShowZoneInfo( cev );
|
||||||
}
|
}
|
||||||
@ -8064,7 +8066,9 @@ void View::DrawZoneInfoChildren( const V& children, int64_t ztime )
|
|||||||
pdqsort_branchless( cti.get(), cti.get() + children.size(), [&ctt] ( const auto& lhs, const auto& rhs ) { return ctt[lhs] > ctt[rhs]; } );
|
pdqsort_branchless( cti.get(), cti.get() + children.size(), [&ctt] ( const auto& lhs, const auto& rhs ) { return ctt[lhs] > ctt[rhs]; } );
|
||||||
|
|
||||||
ImGui::Columns( 2 );
|
ImGui::Columns( 2 );
|
||||||
|
ImGui::Indent( ImGui::GetTreeNodeToLabelSpacing() );
|
||||||
TextColoredUnformatted( ImVec4( 1.0f, 1.0f, 0.4f, 1.0f ), "Self time" );
|
TextColoredUnformatted( ImVec4( 1.0f, 1.0f, 0.4f, 1.0f ), "Self time" );
|
||||||
|
ImGui::Unindent( ImGui::GetTreeNodeToLabelSpacing() );
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
char buf[128];
|
char buf[128];
|
||||||
PrintStringPercent( buf, TimeToString( ztime - ctime ), double( ztime - ctime ) / ztime * 100 );
|
PrintStringPercent( buf, TimeToString( ztime - ctime ), double( ztime - ctime ) / ztime * 100 );
|
||||||
@ -8374,7 +8378,9 @@ void View::DrawGpuInfoChildren( const V& children, int64_t ztime )
|
|||||||
pdqsort_branchless( cgvec.begin(), cgvec.end(), []( const auto& lhs, const auto& rhs ) { return lhs->t > rhs->t; } );
|
pdqsort_branchless( cgvec.begin(), cgvec.end(), []( const auto& lhs, const auto& rhs ) { return lhs->t > rhs->t; } );
|
||||||
|
|
||||||
ImGui::Columns( 2 );
|
ImGui::Columns( 2 );
|
||||||
|
ImGui::Indent( ImGui::GetTreeNodeToLabelSpacing() );
|
||||||
TextColoredUnformatted( ImVec4( 1.0f, 1.0f, 0.4f, 1.0f ), "Self time" );
|
TextColoredUnformatted( ImVec4( 1.0f, 1.0f, 0.4f, 1.0f ), "Self time" );
|
||||||
|
ImGui::Unindent( ImGui::GetTreeNodeToLabelSpacing() );
|
||||||
ImGui::NextColumn();
|
ImGui::NextColumn();
|
||||||
char buf[128];
|
char buf[128];
|
||||||
PrintStringPercent( buf, TimeToString( ztime - ctime ), double( ztime - ctime ) / ztime * 100 );
|
PrintStringPercent( buf, TimeToString( ztime - ctime ), double( ztime - ctime ) / ztime * 100 );
|
||||||
@ -8390,9 +8396,9 @@ void View::DrawGpuInfoChildren( const V& children, int64_t ztime )
|
|||||||
{
|
{
|
||||||
auto& cev = a(children[cgr.v.front()]);
|
auto& cev = a(children[cgr.v.front()]);
|
||||||
const auto txt = m_worker.GetZoneName( cev );
|
const auto txt = m_worker.GetZoneName( cev );
|
||||||
bool b = false;
|
|
||||||
ImGui::PushID( (int)cgr.v.front() );
|
ImGui::PushID( (int)cgr.v.front() );
|
||||||
if( ImGui::Selectable( txt, &b, ImGuiSelectableFlags_SpanAllColumns ) )
|
ImGui::TreeNodeEx( txt, ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen );
|
||||||
|
if( ImGui::IsItemClicked() )
|
||||||
{
|
{
|
||||||
ShowZoneInfo( cev, m_gpuInfoWindowThread );
|
ShowZoneInfo( cev, m_gpuInfoWindowThread );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user