1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Merge da26d1c190eb4e23faae79c9676bbceb77a59efb into dd6933fe32d92b7aedc5f80e7a91e37bb47d229e

This commit is contained in:
Ben Vanik 2022-06-29 14:15:13 +09:00 committed by GitHub
commit 955a1f8da1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8578,7 +8578,7 @@ void View::DrawGpuInfoChildren( const V& children, int64_t ztime )
Vector<uint32_t> v;
};
uint64_t ctime = 0;
unordered_flat_map<int16_t, ChildGroup> cmap;
unordered_flat_map<StringRef, ChildGroup, StringRefHasher, StringRefComparator> cmap;
cmap.reserve( 128 );
for( size_t i=0; i<children.size(); i++ )
{
@ -8586,10 +8586,11 @@ void View::DrawGpuInfoChildren( const V& children, int64_t ztime )
const auto cend = m_worker.GetZoneEnd( child );
const auto ct = cend - child.GpuStart();
const auto srcloc = child.SrcLoc();
const auto name = m_worker.GetSourceLocation( srcloc ).name;
ctime += ct;
auto it = cmap.find( srcloc );
if( it == cmap.end() ) it = cmap.emplace( srcloc, ChildGroup { srcloc } ).first;
auto it = cmap.find( name );
if( it == cmap.end() ) it = cmap.emplace( name, ChildGroup { srcloc } ).first;
it->second.t += ct;
it->second.v.push_back( i );