Don't use source location data before it's ready.

This commit is contained in:
Bartosz Taudul 2019-09-16 15:37:57 +02:00
parent e0105451f6
commit 5429f04614

View File

@ -12182,9 +12182,12 @@ void View::ZoneTooltip( const ZoneEvent& ev )
ImGui::Separator();
TextFocused( "Execution time:", TimeToString( ztime ) );
#ifndef TRACY_NO_STATISTICS
auto& zoneData = m_worker.GetZonesForSourceLocation( ev.SrcLoc() );
ImGui::SameLine();
ImGui::TextDisabled( "(%.2f%% of average time)", float( ztime ) / zoneData.total * zoneData.zones.size() * 100 );
if( m_worker.AreSourceLocationZonesReady() )
{
auto& zoneData = m_worker.GetZonesForSourceLocation( ev.SrcLoc() );
ImGui::SameLine();
ImGui::TextDisabled( "(%.2f%% of average time)", float( ztime ) / zoneData.total * zoneData.zones.size() * 100 );
}
#endif
TextFocused( "Self time:", TimeToString( selftime ) );
if( ztime != 0 )