@@ -46,7 +46,7 @@ bool View::DrawGpu( const TimelineContext& ctx, const GpuCtxData& gpu, int& offs
4646 const auto begin = tlm.front ().Start ();
4747 const auto drift = GpuDrift ( &gpu );
4848 if ( !singleThread ) offset += sstep;
49- const auto partDepth = DispatchGpuZoneLevel ( tl, hover, pxns, int64_t ( nspx ), wpos, offset, 0 , gpu. thread , &gpu, yMin, yMax, begin, drift );
49+ const auto partDepth = DispatchGpuZoneLevel ( tl, hover, pxns, int64_t ( nspx ), wpos, offset, 0 , &gpu, yMin, yMax, begin, drift );
5050 if ( partDepth != 0 )
5151 {
5252 if ( !singleThread )
@@ -73,7 +73,7 @@ bool View::DrawGpu( const TimelineContext& ctx, const GpuCtxData& gpu, int& offs
7373 const auto begin = tl.front ()->Start ();
7474 const auto drift = GpuDrift ( &gpu );
7575 if ( !singleThread ) offset += sstep;
76- const auto partDepth = DispatchGpuZoneLevel ( tl, hover, pxns, int64_t ( nspx ), wpos, offset, 0 , gpu. thread , &gpu, yMin, yMax, begin, drift );
76+ const auto partDepth = DispatchGpuZoneLevel ( tl, hover, pxns, int64_t ( nspx ), wpos, offset, 0 , &gpu, yMin, yMax, begin, drift );
7777 if ( partDepth != 0 )
7878 {
7979 if ( !singleThread )
@@ -97,7 +97,7 @@ bool View::DrawGpu( const TimelineContext& ctx, const GpuCtxData& gpu, int& offs
9797 return depth != 0 ;
9898}
9999
100- int View::DispatchGpuZoneLevel ( const Vector<short_ptr<ZoneEvent>>& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int _offset, int depth, uint64_t thread, const GpuCtxData *ctx, float yMin, float yMax, int64_t begin, int drift )
100+ int View::DispatchGpuZoneLevel ( const Vector<short_ptr<ZoneEvent>>& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int _offset, int depth, const GpuCtxData *ctx, float yMin, float yMax, int64_t begin, int drift )
101101{
102102 const auto ty = ImGui::GetTextLineHeight ();
103103 const auto ostep = ty + 1 ;
@@ -108,28 +108,28 @@ int View::DispatchGpuZoneLevel( const Vector<short_ptr<ZoneEvent>>& vec, bool ho
108108 {
109109 if ( vec.is_magic () )
110110 {
111- return DrawGpuZoneLevel<VectorAdapterDirect<ZoneEvent>>( *(Vector<ZoneEvent>*)&vec, hover, pxns, nspx, wpos, _offset, depth, thread, ctx, yMin, yMax, begin, drift );
111+ return DrawGpuZoneLevel<VectorAdapterDirect<ZoneEvent>>( *(Vector<ZoneEvent>*)&vec, hover, pxns, nspx, wpos, _offset, depth, ctx, yMin, yMax, begin, drift );
112112 }
113113 else
114114 {
115- return DrawGpuZoneLevel<VectorAdapterPointer<ZoneEvent>>( vec, hover, pxns, nspx, wpos, _offset, depth, thread, ctx, yMin, yMax, begin, drift );
115+ return DrawGpuZoneLevel<VectorAdapterPointer<ZoneEvent>>( vec, hover, pxns, nspx, wpos, _offset, depth, ctx, yMin, yMax, begin, drift );
116116 }
117117 }
118118 else
119119 {
120120 if ( vec.is_magic () )
121121 {
122- return SkipGpuZoneLevel<VectorAdapterDirect<ZoneEvent>>( *(Vector<ZoneEvent>*)&vec, hover, pxns, nspx, wpos, _offset, depth, thread, ctx, yMin, yMax, begin, drift );
122+ return SkipGpuZoneLevel<VectorAdapterDirect<ZoneEvent>>( *(Vector<ZoneEvent>*)&vec, hover, pxns, nspx, wpos, _offset, depth, ctx, yMin, yMax, begin, drift );
123123 }
124124 else
125125 {
126- return SkipGpuZoneLevel<VectorAdapterPointer<ZoneEvent>>( vec, hover, pxns, nspx, wpos, _offset, depth, thread, ctx, yMin, yMax, begin, drift );
126+ return SkipGpuZoneLevel<VectorAdapterPointer<ZoneEvent>>( vec, hover, pxns, nspx, wpos, _offset, depth, ctx, yMin, yMax, begin, drift );
127127 }
128128 }
129129}
130130
131131template <typename Adapter, typename V>
132- int View::DrawGpuZoneLevel ( const V& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int _offset, int depth, uint64_t thread, const GpuCtxData* ctx, float yMin, float yMax, int64_t begin, int drift )
132+ int View::DrawGpuZoneLevel ( const V& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int _offset, int depth, const GpuCtxData* ctx, float yMin, float yMax, int64_t begin, int drift )
133133{
134134 // cast to uint64_t, so that unended zones (end = -1) are still drawn
135135 auto it = std::lower_bound ( vec.begin (), vec.end (), std::max<int64_t >( 0 , m_vd.zvStart ), [begin, drift] ( const auto & l, const auto & r ) { Adapter a; return (uint64_t )AdjustGpuTime ( a (l).End (), begin, drift ) < (uint64_t )r; } );
@@ -159,7 +159,7 @@ int View::DrawGpuZoneLevel( const V& vec, bool hover, double pxns, int64_t nspx,
159159 const auto start = AdjustGpuTime ( ev.GpuStart (), begin, drift );
160160 end = AdjustGpuTime ( end, begin, drift );
161161 const auto zsz = std::max ( ( end - start ) * pxns, pxns * 0.5 );
162- const auto zoneThread = thread != 0 ? thread : m_worker.DecompressThread ( ev.Thread () );
162+ const auto zoneThread = ctx-> thread != 0 ? ctx-> thread : m_worker.DecompressThread ( ev.Thread () );
163163 if ( zsz < MinVisSize )
164164 {
165165 const auto color = GetZoneColor ( { &ev.event , ctx }, zoneThread, depth );
@@ -231,7 +231,7 @@ int View::DrawGpuZoneLevel( const V& vec, bool hover, double pxns, int64_t nspx,
231231 {
232232 if ( ev.Child () >= 0 )
233233 {
234- const auto d = DispatchGpuZoneLevel ( m_worker.GetGpuChildren ( ev.Child () ), hover, pxns, nspx, wpos, _offset, depth, thread, ctx, yMin, yMax, begin, drift );
234+ const auto d = DispatchGpuZoneLevel ( m_worker.GetGpuChildren ( ev.Child () ), hover, pxns, nspx, wpos, _offset, depth, ctx, yMin, yMax, begin, drift );
235235 if ( d > maxdepth ) maxdepth = d;
236236 }
237237
@@ -311,7 +311,7 @@ int View::DrawGpuZoneLevel( const V& vec, bool hover, double pxns, int64_t nspx,
311311}
312312
313313template <typename Adapter, typename V>
314- int View::SkipGpuZoneLevel ( const V& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int _offset, int depth, uint64_t thread, const GpuCtxData* ctx, float yMin, float yMax, int64_t begin, int drift )
314+ int View::SkipGpuZoneLevel ( const V& vec, bool hover, double pxns, int64_t nspx, const ImVec2& wpos, int _offset, int depth, const GpuCtxData* ctx, float yMin, float yMax, int64_t begin, int drift )
315315{
316316 // cast to uint64_t, so that unended zones (end = -1) are still drawn
317317 auto it = std::lower_bound ( vec.begin (), vec.end (), std::max<int64_t >( 0 , m_vd.zvStart ), [begin, drift] ( const auto & l, const auto & r ) { Adapter a; return (uint64_t )AdjustGpuTime ( a (l).End (), begin, drift ) < (uint64_t )r; } );
@@ -356,7 +356,7 @@ int View::SkipGpuZoneLevel( const V& vec, bool hover, double pxns, int64_t nspx,
356356 {
357357 if ( ev.Child () >= 0 )
358358 {
359- const auto d = DispatchGpuZoneLevel ( m_worker.GetGpuChildren ( ev.Child () ), hover, pxns, nspx, wpos, _offset, depth, thread, ctx, yMin, yMax, begin, drift );
359+ const auto d = DispatchGpuZoneLevel ( m_worker.GetGpuChildren ( ev.Child () ), hover, pxns, nspx, wpos, _offset, depth, ctx, yMin, yMax, begin, drift );
360360 if ( d > maxdepth ) maxdepth = d;
361361 }
362362 ++it;
0 commit comments