The cooperative-load section already streams each item into shared memory
once per workgroup, but the per-pixel inner loop then recomputed values
that are constant for the whole item/glyph. The compiler can't hoist them
itself — they read shared memory at a varying index.
Precompute them once per item at load time into new shared slots:
- ui-images / ui-text / ui-fused (images+text phases): invRectSize =
1.0/rect.zw, turning the per-pixel `(sp-rect.xy)/rect.zw` vec2 divide
into a multiply.
- ui-text / ui-fused (text phase): the SDF AA `band` (a vec2 divide +
two maxes depending only on the glyph's uv span and rect size).
In ui-fused the new slots (s_inv, s_band) are reused across phases like
the existing s_v* scratch, so the LDS bump is per-category, not summed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>