Tables: Garbage collection to relieve draw splitter buffers + for test engine: compact settings, remove table.

This commit is contained in:
ocornut
2020-11-03 11:25:36 +01:00
parent f80097ca96
commit e5a5256971
3 changed files with 80 additions and 4 deletions

View File

@ -2952,6 +2952,7 @@ void ImGui::GcCompactTransientMiscBuffers()
ImGuiContext& g = *GImGui;
g.ItemFlagsStack.clear();
g.GroupStack.clear();
TableGcCompactSettings();
}
// Free up/compact internal window buffers, we can use this when a window becomes unused.
@ -3906,6 +3907,11 @@ void ImGui::NewFrame()
if (!window->WasActive && !window->MemoryCompacted && window->LastTimeActive < memory_compact_start_time)
GcCompactTransientWindowBuffers(window);
}
// Garbage collect transient buffers of recently unused tables
for (int i = 0; i < g.TablesLastTimeActive.Size; i++)
if (g.TablesLastTimeActive[i] >= 0.0f && g.TablesLastTimeActive[i] < memory_compact_start_time)
TableGcCompactTransientBuffers(g.Tables.GetByIndex(i));
if (g.GcCompactAll)
GcCompactTransientMiscBuffers();
g.GcCompactAll = false;