diff --git a/server/TracyEvent.hpp b/server/TracyEvent.hpp index 62b35398..a86d0314 100644 --- a/server/TracyEvent.hpp +++ b/server/TracyEvent.hpp @@ -131,6 +131,7 @@ struct GpuEvent int64_t gpuStart; int64_t gpuEnd; int32_t srcloc; + uint16_t thread; // This must be last. All above is read/saved as-is. Vector child; diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 86693087..f01d89dd 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -499,12 +499,13 @@ Worker::Worker( FileRead& f, EventType::Type eventMask ) if( fileVer <= FileVersion( 0, 3, 1 ) ) { ctx->period = 1.f; + ReadTimelinePre032( f, ctx->timeline ); } else { f.Read( ctx->period ); + ReadTimeline( f, ctx->timeline ); } - ReadTimeline( f, ctx->timeline ); m_data.gpuData.push_back_no_space_check( ctx ); } @@ -1803,6 +1804,7 @@ void Worker::ProcessGpuZoneBegin( const QueueGpuZoneBegin& ev ) zone->gpuStart = std::numeric_limits::max(); zone->gpuEnd = -1; zone->srcloc = ShrinkSourceLocation( ev.srcloc ); + zone->thread = CompressThread( ev.thread ); m_data.lastTime = std::max( m_data.lastTime, zone->cpuStart ); @@ -2113,6 +2115,16 @@ void Worker::ReadTimeline( FileRead& f, Vector& vec ) } } +void Worker::ReadTimelinePre032( FileRead& f, Vector& vec ) +{ + uint64_t sz; + f.Read( sz ); + if( sz != 0 ) + { + ReadTimelinePre032( f, vec, sz ); + } +} + void Worker::ReadTimeline( FileRead& f, Vector& vec, uint16_t thread, uint64_t size ) { assert( size != 0 ); @@ -2170,6 +2182,22 @@ void Worker::ReadTimeline( FileRead& f, Vector& vec, uint64_t size ) } } +void Worker::ReadTimelinePre032( FileRead& f, Vector& vec, uint64_t size ) +{ + assert( size != 0 ); + vec.reserve_non_zero( size ); + + for( uint64_t i=0; i(); + vec.push_back_no_space_check( zone ); + + f.Read( zone, 36 ); + zone->thread = 0; + ReadTimelinePre032( f, zone->child ); + } +} + void Worker::Write( FileWrite& f ) { f.Write( FileHeader, sizeof( FileHeader ) ); diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index c53bc7ed..d3f55046 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -251,9 +251,11 @@ private: tracy_force_inline void ReadTimeline( FileRead& f, Vector& vec, uint16_t thread ); tracy_force_inline void ReadTimeline( FileRead& f, Vector& vec ); + tracy_force_inline void ReadTimelinePre032( FileRead& f, Vector& vec ); void ReadTimeline( FileRead& f, Vector& vec, uint16_t thread, uint64_t size ); void ReadTimeline( FileRead& f, Vector& vec, uint64_t size ); + void ReadTimelinePre032( FileRead& f, Vector& vec, uint64_t size ); void WriteTimeline( FileWrite& f, const Vector& vec ); void WriteTimeline( FileWrite& f, const Vector& vec );