[glsl-in] switch case using const int causes downstream panic #4644
Labels
area: naga front-end
lang: GLSL
OpenGL Shading Language
naga
Shader Translator
type: enhancement
New feature or request
Description
Using switch/case in GLSL requires the use of integers. See this minimal example on Shadertoy: https://www.shadertoy.com/view/DtccWr
(declaring non constant ints at the top is not allowed and throws and approbierte error during validation)
Using the shadertoy utility in wgpu-py to make it valid glsl and then trying to run it with wgpu-py results in the panic below.
See this gist of the fragment shadercode which is produced.
This fragment shadercode does validate with naga, but errors when translating to .wgsl:
fall-through switch case block
which might be related?Full error trace:
The text was updated successfully, but these errors were encountered: