[perf][LOW] nonuniformEXT on dynamically-uniform font slots (text shader) #49

Closed
opened 2026-06-16 16:51:31 +02:00 by jorijnvdgraaf · 0 comments

Subsystem: UI GLSL shaders
Location: shaders/ui-text.comp.glsl:39-43
Impact: LOW · Effort: Small

Problem

pc.fontTextureSlot/pc.fontSamplerSlot are push constants (provably dynamically uniform) but wrapped in nonuniformEXT, forcing the per-invocation divergent-descriptor path and inhibiting hoisting the uniform load out of the per-pixel loop.

Proposed fix

Drop nonuniformEXT on the text shader's push-constant font slots only. Zero correctness risk — it is a read-index decoration.

Correctness caveat

Do not apply to ui-images.comp.glsl — its texSlot/sampSlot come from an SSBO load, which the compiler cannot prove uniform. Text-shader push constants only.

**Subsystem:** UI GLSL shaders **Location:** `shaders/ui-text.comp.glsl:39-43` **Impact:** LOW · **Effort:** Small ### Problem `pc.fontTextureSlot`/`pc.fontSamplerSlot` are push constants (provably dynamically uniform) but wrapped in `nonuniformEXT`, forcing the per-invocation divergent-descriptor path and inhibiting hoisting the uniform load out of the per-pixel loop. ### Proposed fix Drop `nonuniformEXT` on the **text shader's push-constant font slots only**. Zero correctness risk — it is a read-index decoration. ### Correctness caveat Do **not** apply to `ui-images.comp.glsl` — its `texSlot`/`sampSlot` come from an SSBO load, which the compiler cannot prove uniform. Text-shader push constants only.
catbot 2026-06-16 17:29:51 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Catcrafts/Crafter.Graphics#49
No description provided.