Commit graph

20 commits

Author SHA1 Message Date
catbot
574242dd30 perf(ui): add additive DispatchFused to collapse consecutive UI passes (#47)
Add a fifth UI compute path — DispatchFused — alongside the four
per-element Dispatch* calls. It composites quads → circles → images →
text (canonical back-to-front order) in ONE dispatch that loads the
destination image once and stores once, eliminating the per-pass
load+store and the inter-pass VkMemoryBarriers a run of consecutive
Dispatch* calls would pay. The win materialises at >= 2 non-empty
categories; an absent category is a zero-trip, push-constant-uniform
loop (~free).

The new uber-kernel (shaders/ui-fused.comp.glsl) reuses each category's
exact cooperative shared-memory tile-cull + per-pixel accumulate, so a
fused category is pixel-identical to its standalone pass. Categories run
sequentially per thread and share one set of shared-memory scratch, so
the VGPR/shared high-water mark stays at the per-category level, not the
sum.

Additive and non-breaking: the per-element Dispatch* calls and the
frozen 48-byte UIDispatchHeader are untouched. DispatchFused gets its own
128-byte push-constant layout (UIFusedHeader: four uvec4 headers + four
per-category clip vec4s). To interleave a custom ui.Dispatch() between
standard passes, bracket it with two DispatchFused calls — the dispatch
boundary is the explicit, app-declared flush point.

WebGPU (Vulkan-second): DispatchFused falls back to the per-element
Dispatch* calls in canonical order — one texture/sampler per dispatch
there can't feed the bindless image phase — so the result matches; only
the load/store fusion is Vulkan-only.

HelloUI now composites its background quads, mouse circle, and label
text in a single DispatchFused. Verified rendering identical on a live
Vulkan/Wayland session.

Resolves #47

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 17:03:24 +00:00
64116cd980 custom shader webgpu 2026-05-18 05:39:17 +02:00
dedf6b0467 webgpu support 2026-05-18 04:58:52 +02:00
1f5697326c UI rewrite 3rd attempt 2026-05-02 21:08:20 +02:00
216972e73a new UI system 2026-05-01 23:35:37 +02:00
d661c88ee2 cleaned up renderer 2026-03-09 20:10:19 +01:00
d0cc3ad16a the great text and type rewrite 2025-12-30 23:28:38 +01:00
3d40256bde rendering element rewrite 2025-12-28 00:05:03 +01:00
4c286e1fd8 removed ignore scaling 2025-12-24 16:11:20 +01:00
70f05160c5 fixed examples 2025-11-27 00:17:06 +01:00
627ef13727 fixes 2025-11-26 02:56:38 +01:00
c3b8761102 actually sensible classes 2025-11-25 20:30:54 +01:00
1c4f476f18 oh yeah its rewrite time 2025-11-25 19:43:40 +01:00
02a6a64c56 merged uielement 2025-11-25 18:52:32 +01:00
721ff8f42f wayland rewrite complete 2025-11-24 01:47:49 +01:00
5ff43e240c integer math 2025-11-23 04:04:53 +01:00
4428cfe12c rewrite time 2025-11-22 20:58:42 +01:00
4bb7219ccf semi working wayland 2025-11-17 00:44:45 +01:00
e7d0bc8f8e new structure complete 2025-11-16 18:52:52 +01:00
c82c8c0887 commit 2025-11-16 15:32:03 +01:00