Don't display CPU usage until data is ready.

This commit is contained in:
Bartosz Taudul 2019-11-05 00:44:36 +01:00
parent 50b96c757e
commit 6a500ccdb3

View File

@ -4416,7 +4416,11 @@ int View::DrawCpuData( int offset, double pxns, const ImVec2& wpos, bool hover,
const auto cpuCnt = m_worker.GetCpuDataCpuCount(); const auto cpuCnt = m_worker.GetCpuDataCpuCount();
assert( cpuCnt != 0 ); assert( cpuCnt != 0 );
#ifdef TRACY_NO_STATISTICS
if( m_vd.drawCpuUsageGraph ) if( m_vd.drawCpuUsageGraph )
#else
if( m_vd.drawCpuUsageGraph && m_worker.IsCpuUsageReady() )
#endif
{ {
const auto cpuUsageHeight = floor( 30.f * ImGui::GetTextLineHeight() / 15.f ); const auto cpuUsageHeight = floor( 30.f * ImGui::GetTextLineHeight() / 15.f );
if( wpos.y + offset + cpuUsageHeight + 3 >= yMin && wpos.y + offset <= yMax ) if( wpos.y + offset + cpuUsageHeight + 3 >= yMin && wpos.y + offset <= yMax )