perf(shaders): drop nonuniformEXT on text font slots
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>
This commit is contained in:
parent
cea57f9af8
commit
a8ed369c71
1 changed files with 5 additions and 2 deletions
|
|
@ -36,9 +36,12 @@ void main() {
|
||||||
vec2 t = (sp - it.rect.xy) / it.rect.zw;
|
vec2 t = (sp - it.rect.xy) / it.rect.zw;
|
||||||
vec2 uv = mix(it.uv.xy, it.uv.zw, t);
|
vec2 uv = mix(it.uv.xy, it.uv.zw, t);
|
||||||
|
|
||||||
|
// Font slots are push constants — provably dynamically uniform, so no
|
||||||
|
// nonuniformEXT: lets the compiler hoist the descriptor load out of the
|
||||||
|
// per-pixel glyph loop and avoid the divergent-descriptor path.
|
||||||
float sdf = texture(
|
float sdf = texture(
|
||||||
sampler2D(uiTextures[nonuniformEXT(pc.fontTextureSlot)],
|
sampler2D(uiTextures[pc.fontTextureSlot],
|
||||||
uiSamplers[nonuniformEXT(pc.fontSamplerSlot)]),
|
uiSamplers[pc.fontSamplerSlot]),
|
||||||
uv
|
uv
|
||||||
).r;
|
).r;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue