Repository navigation
GX: write constants as f32 literals instead of abstract floats - #319
StilesCrisis wants to merge 1 commit into
Conversation
The TEV alpha arguments used untyped float literals like "0.0" and "(7.0/8.0)". When every argument of a combiner was a constant, the shader contained mix(0.0, 0.0, 0.0), which wgpu's naga (Firefox) can't evaluate as a constant expression yet, so it rejected the shader with "Abstract types may only appear in constant expressions". Writing them as f32 literals (the color arguments already use vec3f) avoids this. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SjpWodBBBeEnJWqBfHy3gy
I see nothing in the linked issue about abstract floats. |
|
I'll defer to @encounter but personally I would say it's more productive to improve wgpu directly. |
|
It's fair to say that eventually naga will catch up and this will be moot. But this PR is pretty trivial, vs what I imagine would be a much more involved naga PR. |
|
I believe that last time we checked, there were other, bigger issues blocking wgpu from running Aurora anyways. |
|
I've got one other fix and then I run in naga. |
|
It's better to fix the upstream issue than fix an otherwise compliant implementation. |
|
That's valid. |

Previously, all of the alpha arguments were written without a
fsuffix, which in WGSL makes them "abstract floats."This breaks Naga, the other major open-source WGSL implementation besides Dawn; it is not able to evaluate constant expressions with abstract values in them. (Known limitation: see gfx-rs/wgpu#4507)
This PR marks the floats with an
fsuffix, which gives them a concrete type and makes Naga happy.