Closed jiradeto closed 5 years ago
Pretty sure this is due to lack of fall-through case handling in SPIRV-Cross, but I'll need to reproduce first.
This was kind of fixed two weeks ago, but the code-gen is still duplicated, so that needs to be fixed.
I was trying to convert SPIR-V to MSL using SPIRV-Cross and found that when a GLSL shader has variable declarations inside a switch statement like the following:
SPIRV-Cross seems to move all declarations in each case into the first case of the switch statement leading to an invalid shader:
Versions:
05ea055096df8b7b8b3e3f7e121279acf83f74c0
)Steps to reproduce:
glslangValidator -V sample.frag -o sample.spv
spirv-cross --msl sample.spv --output result.msl
Note that before running SPIRV-Cross, I also used
spirv-val
to check that the SPIR-V produced by glslangValidator is valid.This archive contains the original fragment shader, the associated SPIR-V, and MSL shader.
Issue found using GraphicsFuzz.