mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-29 08:54:34 +00:00
Indicate that memory limit was hit with notification triangle color.
This commit is contained in:
parent
89f1fb4825
commit
68473381b9
@ -998,14 +998,22 @@ bool View::DrawImpl()
|
|||||||
if( dx < targetLabelSize ) ImGui::SameLine( cx + targetLabelSize );
|
if( dx < targetLabelSize ) ImGui::SameLine( cx + targetLabelSize );
|
||||||
ImGui::Spacing();
|
ImGui::Spacing();
|
||||||
|
|
||||||
if( m_worker.GetMemoryLimit() > 0 )
|
const auto memoryLimit = m_worker.GetMemoryLimit();
|
||||||
|
if( memoryLimit > 0 )
|
||||||
{
|
{
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
if( memUsage.load( std::memory_order_relaxed ) > memoryLimit )
|
||||||
|
{
|
||||||
|
TextColoredUnformatted( 0xFF2222FF, ICON_FA_TRIANGLE_EXCLAMATION );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
TextColoredUnformatted( 0xFF00FFFF, ICON_FA_TRIANGLE_EXCLAMATION );
|
TextColoredUnformatted( 0xFF00FFFF, ICON_FA_TRIANGLE_EXCLAMATION );
|
||||||
|
}
|
||||||
if( ImGui::IsItemHovered() )
|
if( ImGui::IsItemHovered() )
|
||||||
{
|
{
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
ImGui::Text( "Memory limit: %s", MemSizeToString( m_worker.GetMemoryLimit() ) );
|
ImGui::Text( "Memory limit: %s", MemSizeToString( memoryLimit ) );
|
||||||
ImGui::EndTooltip();
|
ImGui::EndTooltip();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user