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

Reduce data collection if TRACY_NO_STATISTICS is defined.

Statistical data collection is only useful if it's meant to be used.
Otherwise it only incurs CPU and memory cost.
This commit is contained in:
Bartosz Taudul
2018-03-18 12:55:54 +01:00
parent 4baea4a74f
commit 7a4e7cbf86
4 changed files with 25 additions and 0 deletions
+7
View File
@@ -2703,6 +2703,10 @@ void View::DrawMessages()
void View::DrawFindZone()
{
ImGui::Begin( "Find Zone", &m_findZone.show );
#ifdef TRACY_NO_STATISTICS
ImGui::TextWrapped( "Collection of statistical data is disabled in this build." );
ImGui::TextWrapped( "Rebuild without the TRACY_NO_STATISTICS macro to enable zone search." );
#else
ImGui::InputText( "", m_findZone.pattern, 1024 );
ImGui::SameLine();
@@ -3243,6 +3247,7 @@ void View::DrawFindZone()
}
#endif
}
#endif
ImGui::End();
}
@@ -3480,6 +3485,7 @@ const GpuEvent* View::GetZoneParent( const GpuEvent& zone ) const
return nullptr;
}
#ifndef TRACY_NO_STATISTICS
void View::FindZones()
{
const auto match = m_worker.GetMatchingSourceLocation( m_findZone.pattern );
@@ -3494,5 +3500,6 @@ void View::FindZones()
}
}
}
#endif
}