Parallel: send only the atlas rows changed since an Actor's copy (instead of the whole texture per update)
Build & Release / build (push) Canceled after 0s

This commit is contained in:
4DBug committed 2026-10-17 09:12:34 -05:00
1 parent cd826cf3ca
commit 4c9bac2117
6 files changed
+83 -11

No files matched your search

+9 -1
View File
@@ -81,10 +81,18 @@ function M.UpdateTexture(tex)
CreateTextureRecord(tex)
return
end
local y0, y1 = math.huge, -1
for _, r in tex.Updates:iter() do
CopyTexturePixels(tex, t.Buffer, r.x, r.y, r.w, r.h)
if r.y < y0 then y0 = r.y end
if r.y + r.h > y1 then y1 = r.y + r.h end
end
t.V = (t.V or 0) + 1 -- parallel workers hold copies, resent when this changes
-- parallel workers hold copies, patched when this changes: Log[V] = changed rows (only the last 16 kept)
local v = (t.V or 0) + 1
t.V = v
t.Log = t.Log or {}
t.Log[v] = y1 > y0 and { y0, y1 } or { 0, 0 }
t.Log[v - 16] = nil
tex:SetStatus(ImTextureStatus.OK)
elseif tex.Status == ImTextureStatus.WantDestroy then
if tex.BackendUserData then