diff --git a/server/TracyEvent.hpp b/server/TracyEvent.hpp index 365a1f43..bfc52043 100644 --- a/server/TracyEvent.hpp +++ b/server/TracyEvent.hpp @@ -405,8 +405,8 @@ struct ThreadData struct GpuCtxThreadData { - Vector timeline; - Vector stack; + Vector> timeline; + Vector> stack; }; struct GpuCtxData diff --git a/server/TracyView.cpp b/server/TracyView.cpp index a03caa58..73a8cd09 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -3289,7 +3289,7 @@ int View::SkipZoneLevel( const Vector& vec, bool hover, double pxns, return maxdepth; } -int View::DispatchGpuZoneLevel( const Vector& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int _offset, int depth, uint64_t thread, float yMin, float yMax, int64_t begin, int drift ) +int View::DispatchGpuZoneLevel( const Vector>& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int _offset, int depth, uint64_t thread, float yMin, float yMax, int64_t begin, int drift ) { const auto ty = ImGui::GetFontSize(); const auto ostep = ty + 1; @@ -3313,7 +3313,7 @@ static int64_t AdjustGpuTime( int64_t time, int64_t begin, int drift ) return time + t / 1000000000 * drift; } -int View::DrawGpuZoneLevel( const Vector& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int _offset, int depth, uint64_t thread, float yMin, float yMax, int64_t begin, int drift ) +int View::DrawGpuZoneLevel( const Vector>& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int _offset, int depth, uint64_t thread, float yMin, float yMax, int64_t begin, int drift ) { const auto delay = m_worker.GetDelay(); const auto resolution = m_worker.GetResolution(); @@ -3473,7 +3473,7 @@ int View::DrawGpuZoneLevel( const Vector& vec, bool hover, double pxn return maxdepth; } -int View::SkipGpuZoneLevel( const Vector& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int _offset, int depth, uint64_t thread, float yMin, float yMax, int64_t begin, int drift ) +int View::SkipGpuZoneLevel( const Vector>& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int _offset, int depth, uint64_t thread, float yMin, float yMax, int64_t begin, int drift ) { const auto delay = m_worker.GetDelay(); const auto resolution = m_worker.GetResolution(); @@ -13372,7 +13372,7 @@ const GpuEvent* View::GetZoneParent( const GpuEvent& zone ) const for( const auto& td : ctx->threadData ) { const GpuEvent* parent = nullptr; - const Vector* timeline = &td.second.timeline; + const Vector>* timeline = &td.second.timeline; if( timeline->empty() ) continue; for(;;) { @@ -13421,7 +13421,7 @@ uint64_t View::GetZoneThread( const GpuEvent& zone ) const for( const auto& ctx : m_worker.GetGpuData() ) { assert( ctx->threadData.size() == 1 ); - const Vector* timeline = &ctx->threadData.begin()->second.timeline; + const Vector>* timeline = &ctx->threadData.begin()->second.timeline; if( timeline->empty() ) continue; for(;;) { @@ -13447,7 +13447,7 @@ const GpuCtxData* View::GetZoneCtx( const GpuEvent& zone ) const { for( const auto& td : ctx->threadData ) { - const Vector* timeline = &td.second.timeline; + const Vector>* timeline = &td.second.timeline; if( timeline->empty() ) continue; for(;;) { diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 2c22d1b0..535eef1c 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -11,6 +11,7 @@ #include "TracyBuzzAnim.hpp" #include "TracyDecayValue.hpp" +#include "TracyShortPtr.hpp" #include "TracyTexture.hpp" #include "TracyUserData.hpp" #include "TracyVector.hpp" @@ -121,9 +122,9 @@ private: int DispatchZoneLevel( const Vector& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int offset, int depth, float yMin, float yMax, uint64_t tid ); int DrawZoneLevel( const Vector& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int offset, int depth, float yMin, float yMax, uint64_t tid ); int SkipZoneLevel( const Vector& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int offset, int depth, float yMin, float yMax, uint64_t tid ); - int DispatchGpuZoneLevel( const Vector& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int offset, int depth, uint64_t thread, float yMin, float yMax, int64_t begin, int drift ); - int DrawGpuZoneLevel( const Vector& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int offset, int depth, uint64_t thread, float yMin, float yMax, int64_t begin, int drift ); - int SkipGpuZoneLevel( const Vector& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int offset, int depth, uint64_t thread, float yMin, float yMax, int64_t begin, int drift ); + int DispatchGpuZoneLevel( const Vector>& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int offset, int depth, uint64_t thread, float yMin, float yMax, int64_t begin, int drift ); + int DrawGpuZoneLevel( const Vector>& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int offset, int depth, uint64_t thread, float yMin, float yMax, int64_t begin, int drift ); + int SkipGpuZoneLevel( const Vector>& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int offset, int depth, uint64_t thread, float yMin, float yMax, int64_t begin, int drift ); void DrawLockHeader( uint32_t id, const LockMap& lockmap, const SourceLocation& srcloc, bool hover, ImDrawList* draw, const ImVec2& wpos, float w, float ty, float offset, uint8_t tid ); int DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos, int offset, LockHighlight& highlight, float yMin, float yMax ); int DrawPlots( int offset, double pxns, const ImVec2& wpos, bool hover, float yMin, float yMax ); diff --git a/server/TracyWorker.cpp b/server/TracyWorker.cpp index 5d5e45d4..4b1b5a9a 100644 --- a/server/TracyWorker.cpp +++ b/server/TracyWorker.cpp @@ -966,7 +966,7 @@ Worker::Worker( FileRead& f, EventType::Type eventMask, bool bgTasks ) { f.Read( sz ); m_data.gpuChildren.reserve_exact( sz, m_slab ); - memset( m_data.zoneChildren.data(), 0, sizeof( Vector ) * sz ); + memset( m_data.zoneChildren.data(), 0, sizeof( Vector> ) * sz ); } childIdx = 0; f.Read( sz ); @@ -4247,7 +4247,7 @@ void Worker::ProcessGpuZoneBeginImpl( GpuEvent* zone, const QueueGpuZoneBegin& e if( back->Child() < 0 ) { back->SetChild( int32_t( m_data.gpuChildren.size() ) ); - m_data.gpuChildren.push_back( Vector() ); + m_data.gpuChildren.push_back( Vector>() ); } timeline = &m_data.gpuChildren[back->Child()]; } @@ -4943,8 +4943,8 @@ void Worker::ReadTimelinePre0510( FileRead& f, GpuEvent* zone, int64_t& refTime, { const auto child = m_data.gpuChildren.size(); zone->SetChild( child ); - m_data.gpuChildren.push_back( Vector() ); - Vector tmp; + m_data.gpuChildren.push_back( Vector>() ); + Vector> tmp; ReadTimelinePre0510( f, tmp, sz, refTime, refGpuTime, fileVer ); m_data.gpuChildren[child] = std::move( tmp ); } @@ -5158,7 +5158,7 @@ void Worker::ReadTimelinePre0510( FileRead& f, Vector& vec, uint16_t while( ++zone != zptr ); } -void Worker::ReadTimeline( FileRead& f, Vector& vec, uint64_t size, int64_t& refTime, int64_t& refGpuTime, int32_t& childIdx ) +void Worker::ReadTimeline( FileRead& f, Vector>& vec, uint64_t size, int64_t& refTime, int64_t& refGpuTime, int32_t& childIdx ) { assert( size != 0 ); vec.reserve_exact( size, m_slab ); @@ -5199,7 +5199,7 @@ void Worker::ReadTimeline( FileRead& f, Vector& vec, uint64_t size, i while( ++zone != zptr ); } -void Worker::ReadTimelinePre0510( FileRead& f, Vector& vec, uint64_t size, int64_t& refTime, int64_t& refGpuTime, int fileVer ) +void Worker::ReadTimelinePre0510( FileRead& f, Vector>& vec, uint64_t size, int64_t& refTime, int64_t& refGpuTime, int fileVer ) { assert( size != 0 ); vec.reserve_exact( size, m_slab ); @@ -5742,7 +5742,7 @@ void Worker::WriteTimeline( FileWrite& f, const Vector& vec, int64_t } } -void Worker::WriteTimeline( FileWrite& f, const Vector& vec, int64_t& refTime, int64_t& refGpuTime ) +void Worker::WriteTimeline( FileWrite& f, const Vector>& vec, int64_t& refTime, int64_t& refGpuTime ) { uint64_t sz = vec.size(); f.Write( &sz, sizeof( sz ) ); diff --git a/server/TracyWorker.hpp b/server/TracyWorker.hpp index 25f78114..f09b168b 100644 --- a/server/TracyWorker.hpp +++ b/server/TracyWorker.hpp @@ -19,6 +19,7 @@ #include "../common/TracySocket.hpp" #include "tracy_flat_hash_map.hpp" #include "TracyEvent.hpp" +#include "TracyShortPtr.hpp" #include "TracySlab.hpp" #include "TracyStringDiscovery.hpp" #include "TracyThreadCompress.hpp" @@ -198,7 +199,7 @@ private: ThreadCompress externalThreadCompress; Vector> zoneChildren; - Vector> gpuChildren; + Vector>> gpuChildren; Vector> zoneVectorCache; @@ -364,7 +365,7 @@ public: const char* GetZoneName( const GpuEvent& ev, const SourceLocation& srcloc ) const; tracy_force_inline const Vector& GetZoneChildren( int32_t idx ) const { return m_data.zoneChildren[idx]; } - tracy_force_inline const Vector& GetGpuChildren( int32_t idx ) const { return m_data.gpuChildren[idx]; } + tracy_force_inline const Vector>& GetGpuChildren( int32_t idx ) const { return m_data.gpuChildren[idx]; } std::vector GetMatchingSourceLocation( const char* query, bool ignoreCase ) const; @@ -563,11 +564,11 @@ private: void ReadTimeline( FileRead& f, Vector& vec, uint16_t thread, uint64_t size, int64_t& refTime, int32_t& childIdx ); void ReadTimelinePre042( FileRead& f, Vector& vec, uint16_t thread, uint64_t size, int fileVer ); void ReadTimelinePre0510( FileRead& f, Vector& vec, uint16_t thread, uint64_t size, int64_t& refTime, int fileVer ); - void ReadTimeline( FileRead& f, Vector& vec, uint64_t size, int64_t& refTime, int64_t& refGpuTime, int32_t& childIdx ); - void ReadTimelinePre0510( FileRead& f, Vector& vec, uint64_t size, int64_t& refTime, int64_t& refGpuTime, int fileVer ); + void ReadTimeline( FileRead& f, Vector>& vec, uint64_t size, int64_t& refTime, int64_t& refGpuTime, int32_t& childIdx ); + void ReadTimelinePre0510( FileRead& f, Vector>& vec, uint64_t size, int64_t& refTime, int64_t& refGpuTime, int fileVer ); void WriteTimeline( FileWrite& f, const Vector& vec, int64_t& refTime ); - void WriteTimeline( FileWrite& f, const Vector& vec, int64_t& refTime, int64_t& refGpuTime ); + void WriteTimeline( FileWrite& f, const Vector>& vec, int64_t& refTime, int64_t& refGpuTime ); int64_t TscTime( int64_t tsc ) { return int64_t( tsc * m_timerMul ); } int64_t TscTime( uint64_t tsc ) { return int64_t( tsc * m_timerMul ); }