Skip to content

Commit 7260429

Browse files
author
Eric Eaton
committed
Remove unneeded thread parameter from GpuTimeline
The thread value can be pulled from the context parameter now.
1 parent 08bfd9a commit 7260429

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

profiler/src/profiler/TracyView.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,11 @@ class View
255255
void DrawZoneList( const TimelineContext& ctx, const std::vector<TimelineDraw>& drawList, int offset, uint64_t tid, int maxDepth, double margin );
256256
void DrawThreadCropper( const int depth, const uint64_t tid, const float xPos, const float yPos, const float ostep, const float cropperWidth, const bool hasCtxSwitches );
257257
void DrawContextSwitchList( const TimelineContext& ctx, const std::vector<ContextSwitchDraw>& drawList, const Vector<ContextSwitchData>& ctxSwitch, int offset, int endOffset, bool isFiber );
258-
int 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 );
258+
int 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 );
259259
template<typename Adapter, typename V>
260-
int 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 );
260+
int 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 );
261261
template<typename Adapter, typename V>
262-
int 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 );
262+
int 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 );
263263
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 );
264264
int DrawLocks( const TimelineContext& ctx, const std::vector<std::unique_ptr<LockDraw>>& lockDraw, uint64_t tid, int _offset, LockHighlight& highlight );
265265
void DrawPlotPoint( const ImVec2& wpos, float x, float y, int offset, uint32_t color, bool hover, bool hasPrev, const PlotItem& item, double prev, PlotType type, PlotValueFormatting format, float PlotHeight, uint64_t name );

profiler/src/profiler/TracyView_GpuTimeline.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

131131
template<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

313313
template<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

Comments
 (0)