Commit Graph
36 Commits
Author SHA1 Message Date
4DBug 5494dfe35e Roblox backend: RasterRect tests a primitive's bounds against the rect before reading its clip (most of a tile's primitives miss a small dirty rect) 2026-10-21 03:35:32 -05:00
4DBug a4d48c9463 Roblox raster: solid spans written two pixels per writef64 (the pixel twice as a normal double; per pixel otherwise), translucent black spans without the colour terms (colour picker SV square), triangle / line quad rows start past an estimate that is never in the span (replay: colorpicker -13%, plots -7%, implot -5%; pixels identical) 2026-10-21 03:35:32 -05:00
4DBug 17ebef78cd Roblox backend: DirtyRects skips AddRect for a changed primitive inside the first dirty rect (where AddRect would merge it, unchanged) 2026-10-21 03:35:32 -05:00
4DBug 8a76c353b5 Roblox raster: per-pixel blend/texel sample inlined in the interpolating triangle paths (rows and columns) and gradient kind 2 (a call per pixel cost more than the math), colours unpacked inline (shared when equal), white texels not folded, flat span constants only when translucent; line quads: bounds before edge setup, fixed texel row when v is constant; narrow solid spans written instead of copied per row (replay: colorpicker -14%, plots -14%, implot -3%; pixels identical) 2026-10-21 03:35:32 -05:00
4DBug 0c0b570da2 Roblox backend: reuse the destroyed atlas texture record's buffer for the next one of the same size (repack)
buffer.create of a 512 KB atlas costs ~0.1-1.8 ms in Studio (spiky); a repack creates one every few frames
in the font size scenario.
2026-10-21 01:24:28 -05:00
4DBug 2b63156f8e Roblox backend: keep 4 prewarmed tiles in the free list (Heartbeat, one per call, never evicting)
A growing layer takes them instead of creating an EditableImage + ImageLabel mid-frame (~90 us per tile in
Studio vs ~7 us from the free list). GetTile: one path for new and recycled tiles (NewTile).
2026-10-21 01:24:28 -05:00
4DBug 183528a191 Roblox raster: tall flat triangles (column walk) write spans like the row path (no BlendPixel call per pixel)
Opaque: direct writes; translucent: the row path's per-span constants + per-destination cache. Same math,
bit-identical (replay hash, t_pixels, t_composite, t_parallel). Replay: triangles ~13 -> ~9 ms, total -5%.
2026-10-21 01:24:28 -05:00
4DBug ad57e5cf11 Roblox backend: DirtyRects skips primitives unchanged at the same list position (paired lists)
Every pixel such a primitive covers is either inside a changed primitive's rect or drawn by the same
primitives in the same order. Headless: 7% fewer pixels rasterized on resize, raster+upload -6..-9%.
2026-10-21 01:24:28 -05:00
4DBug a01d87e2d1 Roblox backend: moved draw lists with drifted vertices: redraw just what they touch (and always redraw it)
A window moved by whole pixels often has a few trig-generated vertices off the exact shift by an ulp (when a
coordinate crosses a power of two): CompareDrawList fell back to the full Collect + Hash (~1/4 of moving
frames), and the tile hashes don't see an ulp, so those primitives were never redrawn (stale pixels vs a
forced redraw, e.g. a moving Bullet). Now CompareDrawList lists the drifted vertices; if all their floor /
ceil (CollectPrims' bounds) shifted too it returns 3: PatchDrawList keeps the tile lists (same primitive
sequence, checked) and marks only the drifted primitives' entries changed (DriftMark, new each frame), so
their tiles redraw just those rects. Otherwise the full path marks them the same way.
2026-10-21 01:24:28 -05:00
4DBug 6952571717 Roblox backend: patches.lua, Luau-tuned replacements of hot library internals (text rendering, text size cache hit)
New backend module installed when the backend loads (the library sources stay the 1:1 port): MT.ImFont.RenderText and
MT.ImDrawList.AddText share one native core (clip rect as numbers, PrimReserve inlined, no CPU fine clip branches,
AddText without the clip rect copy and extra call); ImFontCalcTextSizeXY checks its cache hit first. Uncommon cases
(byte-table text, CPU fine clip, > 10k bytes unwrapped, texture change mid-text) go to the originals. One switch per
patch (Enabled), M.Set() for in-process A/B. Draw hashes, composite pixels identical; imgui time -3..-4% (Studio
in-process A/B and headless).
2026-10-21 01:04:21 -05:00
4DBug c1c59bde47 Roblox backend: tiles no longer allocate a 64 KB CPU pixel buffer each (unused since dirty rects are rasterized straight into upload buffers) 2026-10-20 15:12:11 -05:00
4DBug aad77d6da5 Roblox backend raster: damage to the uniform rows collected in one pending rect (applied when a span needs them); spans process runs of rows with the same uniform piece at once 2026-10-20 15:11:51 -05:00
4DBug 1e9d2c669c Roblox backend raster: uniform rows are only valid inside the last ClearRect (no reset passes) 2026-10-20 15:11:51 -05:00
4DBug b30d3ba362 Roblox backend raster: glyph blits read consecutive texels without the column table, cache white-texel blends per alpha 2026-10-20 15:11:51 -05:00
4DBug beb9da1516 Roblox backend raster: uniform region tracked per row instead of one rect (translucent spans over uniform rows fill instead of blending per pixel) 2026-10-20 15:11:51 -05:00
4DBug b9d736531e Roblox backend: rasterize dirty rects straight into the upload buffer (no CopySubRect, no cold 64 KB tile buffer) 2026-10-20 15:11:51 -05:00
4DBug 4cc328560d Parallel: Actors free destroyed textures (each atlas grow/repack left a full copy in every Actor), atlas patches send the updated glyph rects instead of whole row spans and are built once per version for all Actors (fonts tex sends 151 -> 91 KB/frame in Studio, TexBytes 35.6 -> 22.2 MB headless); Actor texture handling moved to Raster.ApplyTextures, which Sync mode now runs on per-Actor copies so t_parallel checks it; t_parallel fonts scenario (new size per frame), check_all runs 620 frames 2026-10-20 14:47:54 -05:00
4DBug c953fb62d7 Textures: typed, unrolled RGBA/Alpha8 row conversion (no zero-skip branch): new 512x256 atlas record 0.54 -> 0.30 ms headless, pixels unchanged 2026-10-20 14:47:54 -05:00
4DBug 4877905466 Roblox render: hot loop locals, native DrawLayer, DirtyRects without copies
- CollectPrims / HashTiles / DirtyRects: the Prim* / slot tables as locals (upvalue access per element was
  measurable: Collect -13%, Hash -8%)
- CollectPrims notes flat rects (PrimFlat): HashTiles no longer re-reads uvs, gradient and texture per quad
- HashTiles: one loop over a primitive's tiles instead of nested for loops (most touch one tile)
- DrawLayer, SweepTiles @native (per-tile bookkeeping -33%)
- DirtyRects: clipped bounds computed once (content bounds from them); the tile's Drawn* hash/flat lists are
  swapped with the layer's lists and the bounds with a scratch set instead of copied per entry
Headless full re-collect of the demo vs 0.4.2: Collect -24%, Hash -48%, bookkeeping -32%. Pixels identical
(t_pixels, t_composite, t_parallel, TileLimit run).
2026-10-20 14:47:19 -05:00
4DBug 1c1111f24b Roblox render: cheaper CollectPrims + HashTiles (per changed draw list)
HashTiles: a touched tile's count/hashes/lists live in slot arrays for the call (one KeySlot lookup per tile
switch instead of ~7 hash-table reads/writes; consecutive primitives alternate tiles ~40% of the time), the
vertex hash is inlined (HashVertex calls weren't inlined and cost more than the hashing), tile ranges come
from the already-relative bounds. Hash values are unchanged.
CollectPrims: the axis aligned rect test runs before the textured line-quad test (mutually exclusive, so the
result is the same; glyphs no longer read their colours/uvs twice), clipped/limit/extent checks per command
from the command's bounds instead of per primitive, and primitives go to their layer lists while collecting
(no PrimKind pass in DrawLists).
Headless full re-collect of the demo (1500 prims): Collect -10%, Hash -35%.
2026-10-20 14:47:19 -05:00
4DBug c1325dd59c Roblox backend: faster unchanged check: CompareDrawList compares vertices as 4 f64 + col (3x fewer reads), indices 4 per step; a moved list's snapshot is shifted in place (ShiftSnapshot) instead of re-snapshotted from another list's Cmd* data 2026-10-20 13:56:21 -05:00
4DBug 62b8296f0c 0.4.2
Build & Release / build (push) Canceled after 0s
- Less garbage per frame: scalar text/label sizes, scratch rects/points, reused clip-stack ImVec4 and window stack entries (160 -> 56 KB/frame on demo+stress, draw hashes unchanged)
- Faster glyph baking: @native rasterizer/rect packer/pixel loops, glyph shape cache, comparator-free edge sort, inline scanline conversion, table.create zero-fill; fix leaked global 'step'
- Textures: new atlases convert only the packed corner, flat row conversion skipping zero pixels
- Raster: uniform-region tracking, direct opaque glyph texels, inlined BlendPixel with per-texel cache
- Raster: textured line quads drawn as one quad, u32 texel reads for constant-colour triangles, column walk for tall narrow triangles (plot bench Raster 4.16 -> 3.21 ms, HashVertex 0.64 -> 0.55 ms, pixels unchanged)
- Parallel: send Actors only changed atlas rows / rows above FillRow (full-copy 1283 -> 619 MB on fontbench x4 Actors); dispatch small and text-heavy frames (MinTiles 1, MinPixels 2048, MaxBytesPerPixel 0)
- Stage timing: Textures and Flush stages; parallel stats explain serial flushes
- extensions/: submodules for imcurveedit-luau, imgradient-luau, imgui-memory-editor-luau, imsequencer-luau; all 9 submodule URLs and README links now on GitHub
- new examples: example_love_extensions, example_roblox_extensions
2026-10-17 13:18:53 -05:00
4DBug 1a5ce09f65 0.4.1
Build & Release / build (push) Canceled after 0s
- TextProxy works for any widget that sets PlatformImeData.WantTextInput (+ SelectedText)
- TextProxy: key-code fallback waits for the TextBox (fixes doubled typing); no stuck Ctrl after paste
- Raster: reversed rects (min > max) draw like upstream (fixes ImNodes/ImPlot box select)
- test harness: --module NAME=path loads extra ModuleScripts
- new tests: t_textproxy_custom, t_rect_flip
- extensions/: submodules for imguicolortextedit-luau, imguizmo-luau, implot-luau, implot3d-luau, imnodes-luau
2026-10-17 07:31:40 -05:00
4DBug 386b0c475e 0.4.0
Build & Release / build (push) Canceled after 0s
2026-10-16 22:53:18 -05:00
4DBug 662e875e43 CI/releases: drop the nodemo bundles (--no-demo build flag kept); remove examples/example_shared; Roblox backend RenderRate defaults to 60 (0 = every frame); README + TODO.txt updated 2026-10-15 10:57:00 -05:00
4DBug 4427cd776e Integration: debug/context fields in ImGuiContext ctor, ImGuiContextHookType, DebugFlashStyleColorIdx=COUNT, CurrentPixelDensity, clipper range/data helpers, full Shutdown cleanup, settings dates (ImGuiSettingsCleanupArgs, CleanupIniSettings, LastUsed=, Platform_SessionDate) + metrics Settings section, ImGuiStyleVar SeparatorSize/DockingSeparatorSize (fixes off-by-one style var table), LogRenderedText restored in RenderText*, combo preview 1.93, InputScalar ValidatedThisFrame, ImGuiListClipperFlags/LogFlags/OldColumnFlags, ImGuiKey digit aliases, backend names 2026-10-15 09:39:17 -05:00
4DBug 5837d00db8 Roblox backend: redraw budget is opt-in (SetRedrawBudget default 0 = every changed tile drawn the same frame) 2026-10-15 00:55:43 -05:00
4DBug 8c3335adf8 Roblox backend perf (pixel-identical): redraw budget (SetRedrawBudget, default 1.5 ms; RenderRate default 0), exact in-place draw list compare + whole-pixel move fast path, partial tile redraws, flat rects hashed by in-tile rect, quads hashed by TL/BR, no full redraw on texture updates, @native CopyTexturePixels, reused partial upload buffers; imgui_draw: @native word wrap, ImStrByte/classifier inlined, text size cache covers wrapped text; t_pixels pixel oracle; run.py RUN_FLAGS 2026-10-14 22:26:38 -05:00
4DBug 6aea0b8cb1 Docking: set node.LastBgColor (closing dock hosts drew white bodies), host skips own bg, fix SetNextWindowBgAlpha; Roblox backend: frames skipped by the render rate cap are drawn later (UI could freeze when the app stopped rendering); t_dock_close test 2026-10-14 06:26:28 -05:00
4DBug d8ef33663e Roblox backend: text proxy is opt-in (SetTextProxy), remove SetTextProxyDebug; new example main.client.luau 2026-10-09 02:22:30 -05:00
4DBug be50735d4d Move LuaJIT compat shims into backends/imgui_impl_love.lua (COMPAT section); remove compat/ 2026-10-08 19:31:22 -05:00
4DBug eb22a9ae8d LÖVE backend + build target (compat/luajit.lua shims, Roblox build unchanged), examples/example_love, examples/example_shared (same app on Roblox and LÖVE), LuaJIT checksum tests 2026-10-08 19:31:22 -05:00
4DBug f8ad67f17f Roblox backend: hidden TextBox proxy for text input
A single off-screen TextBox holds focus while an imgui text field is active, so the OS
delivers typing (any layout/unicode), paste and copy/cut. Its text mirrors imgui selection
(fully selected) so Ctrl+C/X copy exactly that; deletions apply as an imgui Backspace;
Ctrl is released around pasted characters. Focus is captured after the click is released,
kept on clicks inside imgui, ends on clicks outside. KeyCode text kept as fallback.
SetTextProxyDebug for logging.
2026-10-08 19:31:22 -05:00
4DBug 1c24dd407d Decal Viewer example (decal/image id -> imgui texture, demo image viewer with grid); backend CreateTexture/DestroyTexture 2026-10-08 17:38:33 -05:00
4DBug df14af2d2e Embed widget example (Instances inside imgui windows, one Frame per id, hidden when not submitted, EmbedFlags) + backend SetOverlay 2026-10-08 17:28:13 -05:00
4DBug 70688e6c8b Reorganize like upstream: library at root (docking/dragdrop/debug tools merged into imgui.lua, tabs into imgui_widgets.lua), single imgui_demo.lua, backends/, fonts/, examples/, docs/; --no-demo build 2026-10-08 16:47:42 -05:00