[perf] Per-glyph-constant SDF AA scale recomputed per pixel (ui-text.comp.glsl) #126
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Catcrafts/Crafter.Graphics#126
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by an adversarially-verified performance audit (confirmed real after a skeptic pass).
Location:
shaders/ui-text.comp.glsl:93-98(alsoui-fused.comp.glsl:315-318)Severity: low · Effort: trivial · Category: gpu
Problem
uvSpan/atlasPerScreen/scalePx/banddepend only on the glyph yet are computed per pixel-glyph (a divide + two maxes).Fix
Precompute
bandonce during the cooperative load into afloat[UI_CHUNK]shared slot. Marginal — the inner loop is dominated by the SDFtexture()fetch, so the realized speedup is small.Merged into #125 — the invRectSize hoist and the SDF-band hoist are the same technique in the same cooperative-load sections of ui-text/ui-fused; one pass through the shaders covers both.