Library: tables without per-instance temporaries in BeginTableEx()/TableUpdateLayout()/TableMergeDrawChannels() (scratch rects, scalar outer size); ImDrawListSplitter::Merge() keeps the command it merges away past Size for reuse (was 6 new ImDrawCmd per table per frame): 435 -> 247 tables/frame allocated for 10 small tables in a window

Draw data unchanged.
This commit is contained in:
4DBug committed 2026-10-21 01:14:31 -05:00
1 parent 437aa50357
commit d994fc01cd
2 files changed
+18 -8

No files matched your search

+5 -1
View File
@@ -4691,7 +4691,11 @@ function MT.ImDrawListSplitter:Merge(draw_list)
-- Merge previous channel last draw command with current channel first draw command if matching.
last_cmd.ElemCount = last_cmd.ElemCount + next_cmd.ElemCount
idx_offset = idx_offset + next_cmd.ElemCount
cmds:erase(1) -- FIXME-OPT: Improve for multiple merges.
-- [Luau] cmds:erase(1), keeping the erased command object past Size for AddDrawCmd() to reuse
local d = cmds.Data
for k = 1, cmds.Size - 1 do d[k] = d[k + 1] end
d[cmds.Size] = next_cmd
cmds.Size = cmds.Size - 1 -- FIXME-OPT: Improve for multiple merges.
end
end
if cmds.Size > 0 then