1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Magic vectors in GPU drawing setup.

This commit is contained in:
Bartosz Taudul 2019-11-10 01:35:57 +01:00
parent 675e6a8d1a
commit 4ed4e1005c

View File

@ -2102,13 +2102,17 @@ void View::DrawZones()
{ {
for( auto& td : v->threadData ) for( auto& td : v->threadData )
{ {
assert( !td.second.timeline.empty() ); auto& tl = td.second.timeline;
if( td.second.timeline.front()->GpuStart() >= 0 ) assert( !tl.empty() );
if( tl.is_magic() )
{ {
const auto begin = td.second.timeline.front()->GpuStart(); auto& tlm = *(Vector<GpuEvent>*)&tl;
if( tlm.front().GpuStart() >= 0 )
{
const auto begin = tlm.front().GpuStart();
const auto drift = GpuDrift( v ); const auto drift = GpuDrift( v );
if( !singleThread ) offset += sstep; if( !singleThread ) offset += sstep;
const auto partDepth = DispatchGpuZoneLevel( td.second.timeline, hover, pxns, int64_t( nspx ), wpos, offset, 0, v->thread, yMin, yMax, begin, drift ); const auto partDepth = DispatchGpuZoneLevel( tl, hover, pxns, int64_t( nspx ), wpos, offset, 0, v->thread, yMin, yMax, begin, drift );
if( partDepth != 0 ) if( partDepth != 0 )
{ {
if( !singleThread ) if( !singleThread )
@ -2128,6 +2132,34 @@ void View::DrawZones()
} }
} }
} }
else
{
if( tl.front()->GpuStart() >= 0 )
{
const auto begin = tl.front()->GpuStart();
const auto drift = GpuDrift( v );
if( !singleThread ) offset += sstep;
const auto partDepth = DispatchGpuZoneLevel( tl, hover, pxns, int64_t( nspx ), wpos, offset, 0, v->thread, yMin, yMax, begin, drift );
if( partDepth != 0 )
{
if( !singleThread )
{
ImGui::PushFont( m_smallFont );
DrawTextContrast( draw, wpos + ImVec2( ty, offset-1-sstep ), 0xFFFFAAAA, m_worker.GetThreadName( td.first ) );
draw->AddLine( wpos + ImVec2( 0, offset+sty-sstep ), wpos + ImVec2( w, offset+sty-sstep ), 0x22FFAAAA );
ImGui::PopFont();
}
offset += ostep * partDepth;
depth += partDepth;
}
else if( !singleThread )
{
offset -= sstep;
}
}
}
}
} }
offset += ostep * 0.2f; offset += ostep * 0.2f;