perf(shaders): drop nonuniformEXT on text font slots #80

Merged
catbot merged 1 commit from claude/issue-49 into master 2026-06-16 17:29:51 +02:00
Member

Problem

In shaders/ui-text.comp.glsl, pc.fontTextureSlot/pc.fontSamplerSlot are push constants (provably dynamically uniform) but were wrapped in nonuniformEXT. This forced the per-invocation divergent-descriptor path and inhibited hoisting the uniform descriptor load out of the per-pixel glyph loop.

Fix

Drop nonuniformEXT on the text shader's push-constant font slots only. This is purely a read-index decoration, so it carries zero correctness risk.

Caveat respected

Not applied to ui-images.comp.glsl — its texSlot/sampSlot come from an SSBO load, which the compiler cannot prove uniform, so nonuniformEXT remains required there.

Testing

  • crafter-build test → 3 passed
  • glslang -V --target-env vulkan1.2 validates the shader cleanly

Resolves #49

### Problem In `shaders/ui-text.comp.glsl`, `pc.fontTextureSlot`/`pc.fontSamplerSlot` are push constants (provably dynamically uniform) but were wrapped in `nonuniformEXT`. This forced the per-invocation divergent-descriptor path and inhibited hoisting the uniform descriptor load out of the per-pixel glyph loop. ### Fix Drop `nonuniformEXT` on the text shader's push-constant font slots only. This is purely a read-index decoration, so it carries zero correctness risk. ### Caveat respected Not applied to `ui-images.comp.glsl` — its `texSlot`/`sampSlot` come from an SSBO load, which the compiler cannot prove uniform, so `nonuniformEXT` remains required there. ### Testing - `crafter-build test` → 3 passed - `glslang -V --target-env vulkan1.2` validates the shader cleanly Resolves #49
fontTextureSlot/fontSamplerSlot are push constants, hence provably
dynamically uniform. Wrapping them in nonuniformEXT forced the
per-invocation divergent-descriptor path and blocked hoisting the
uniform descriptor load out of the per-pixel glyph loop.

Removing the decoration is zero correctness risk — it is purely a
read-index hint. Not applied to ui-images.comp.glsl, whose slots come
from an SSBO load the compiler cannot prove uniform.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
catbot merged commit 58e9e0a747 into master 2026-06-16 17:29:51 +02:00
catbot deleted branch claude/issue-49 2026-06-16 17:29:51 +02:00
Sign in to join this conversation.
No reviewers
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!80
No description provided.