diff --git a/server/TracyEvent.hpp b/server/TracyEvent.hpp index 55313d3d..d4fa12f7 100644 --- a/server/TracyEvent.hpp +++ b/server/TracyEvent.hpp @@ -504,7 +504,7 @@ enum { FrameImageSize = sizeof( FrameImage ) }; struct GhostZone { Int48 start, end; - CallstackFrameId frame; + Int24 frame; int32_t child; }; diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 948d5f44..0e98ba4e 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -1763,16 +1763,28 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks ) do { auto& entry = cs[idx]; + uint32_t fid; + auto it = m_data.ghostFramesMap.find( entry.data ); + if( it == m_data.ghostFramesMap.end() ) + { + fid = uint32_t( m_data.ghostFrames.size() ); + m_data.ghostFrames.push_back( entry ); + m_data.ghostFramesMap.emplace( entry.data, fid ); + } + else + { + fid = it->second; + } if( vec->empty() ) { gcnt++; auto& zone = vec->push_next(); zone.start.SetVal( time ); zone.end.SetVal( time + m_samplingPeriod ); - zone.frame = entry; + zone.frame.SetVal( fid ); zone.child = -1; } - else if( vec->back().frame == entry ) + else if( vec->back().frame.Val() == fid ) { auto& zone = vec->back(); zone.end.SetVal( time + m_samplingPeriod ); @@ -1784,7 +1796,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks ) auto& zone = vec->push_next(); zone.start.SetVal( time ); zone.end.SetVal( time + m_samplingPeriod ); - zone.frame = entry; + zone.frame.SetVal( fid ); zone.child = -1; } if( idx > 0 ) diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index c12cd176..75b57dfc 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -245,6 +245,8 @@ private: Vector>> gpuChildren; #ifndef TRACY_NO_STATISTICS Vector> ghostChildren; + Vector ghostFrames; + unordered_flat_map ghostFramesMap; #endif Vector>> zoneVectorCache;