mirror of
https://github.com/wolfpld/tracy
synced 2025-05-07 23:43:52 +00:00
Shared index for all call stack tree nodes.
This commit is contained in:
parent
17273c5987
commit
4e23ce9a24
@ -6500,7 +6500,8 @@ void View::DrawMemory()
|
||||
auto& mem = m_worker.GetMemData();
|
||||
auto tree = GetCallstackFrameTree( mem );
|
||||
|
||||
DrawFrameTreeLevel( tree );
|
||||
int idx = 0;
|
||||
DrawFrameTreeLevel( tree, idx );
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
@ -6508,11 +6509,10 @@ void View::DrawMemory()
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
void View::DrawFrameTreeLevel( std::vector<CallstackFrameTree>& tree ) const
|
||||
void View::DrawFrameTreeLevel( std::vector<CallstackFrameTree>& tree, int& idx ) const
|
||||
{
|
||||
auto& io = ImGui::GetIO();
|
||||
|
||||
int idx = 0;
|
||||
pdqsort_branchless( tree.begin(), tree.end(), [] ( const auto& lhs, const auto& rhs ) { return lhs.allocInclusive > rhs.allocInclusive; } );
|
||||
for( auto& v : tree )
|
||||
{
|
||||
@ -6593,7 +6593,7 @@ void View::DrawFrameTreeLevel( std::vector<CallstackFrameTree>& tree ) const
|
||||
|
||||
if( expand )
|
||||
{
|
||||
DrawFrameTreeLevel( v.children );
|
||||
DrawFrameTreeLevel( v.children, idx );
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ private:
|
||||
void ListMemData( T ptr, T end, std::function<void(T&)> DrawAddress, const char* id = nullptr );
|
||||
|
||||
std::vector<CallstackFrameTree> GetCallstackFrameTree( const MemData& mem ) const;
|
||||
void DrawFrameTreeLevel( std::vector<CallstackFrameTree>& tree ) const;
|
||||
void DrawFrameTreeLevel( std::vector<CallstackFrameTree>& tree, int& idx ) const;
|
||||
|
||||
void DrawInfoWindow();
|
||||
void DrawZoneInfoWindow();
|
||||
|
Loading…
x
Reference in New Issue
Block a user