mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-23 14:54:34 +00:00
Magic vectors in GPU drawing setup.
This commit is contained in:
parent
675e6a8d1a
commit
4ed4e1005c
@ -2102,29 +2102,61 @@ 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;
|
||||||
const auto drift = GpuDrift( v );
|
if( tlm.front().GpuStart() >= 0 )
|
||||||
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 );
|
|
||||||
if( partDepth != 0 )
|
|
||||||
{
|
{
|
||||||
if( !singleThread )
|
const auto begin = tlm.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 )
|
||||||
{
|
{
|
||||||
ImGui::PushFont( m_smallFont );
|
if( !singleThread )
|
||||||
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::PushFont( m_smallFont );
|
||||||
ImGui::PopFont();
|
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;
|
offset += ostep * partDepth;
|
||||||
depth += partDepth;
|
depth += partDepth;
|
||||||
|
}
|
||||||
|
else if( !singleThread )
|
||||||
|
{
|
||||||
|
offset -= sstep;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if( !singleThread )
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if( tl.front()->GpuStart() >= 0 )
|
||||||
{
|
{
|
||||||
offset -= sstep;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user