Adapt GetZoneEnd() for magic vectors.

This commit is contained in:
Bartosz Taudul 2019-11-10 01:43:28 +01:00
parent 7c277234e7
commit 9b52152e77

View File

@ -2063,7 +2063,16 @@ int64_t Worker::GetZoneEnd( const ZoneEvent& ev )
{ {
if( ptr->End() >= 0 ) return ptr->End(); if( ptr->End() >= 0 ) return ptr->End();
if( ptr->Child() < 0 ) return ptr->Start(); if( ptr->Child() < 0 ) return ptr->Start();
ptr = GetZoneChildren( ptr->Child() ).back(); auto& children = GetZoneChildren( ptr->Child() );
if( children.is_magic() )
{
auto& c = *(Vector<ZoneEvent>*)&children;
ptr = &c.back();
}
else
{
ptr = children.back();
}
} }
} }
@ -2074,7 +2083,16 @@ int64_t Worker::GetZoneEnd( const GpuEvent& ev )
{ {
if( ptr->GpuEnd() >= 0 ) return ptr->GpuEnd(); if( ptr->GpuEnd() >= 0 ) return ptr->GpuEnd();
if( ptr->Child() < 0 ) return ptr->GpuStart() >= 0 ? ptr->GpuStart() : m_data.lastTime; if( ptr->Child() < 0 ) return ptr->GpuStart() >= 0 ? ptr->GpuStart() : m_data.lastTime;
ptr = GetGpuChildren( ptr->Child() ).back(); auto& children = GetGpuChildren( ptr->Child() );
if( children.is_magic() )
{
auto& c = *(Vector<GpuEvent>*)&children;
ptr = &c.back();
}
else
{
ptr = children.back();
}
} }
} }