Open manas-kulkarni opened 8 months ago
There's a bug in how you're applying nonuniformEXT, see https://github.com/KhronosGroup/Vulkan-Samples/blob/main/shaders/descriptor_indexing/nonuniform-quads.frag#L33-L39
Thanks. Would it be possible for the tools to warn about this?
I'm the wrong person to ask that but I also wouldn't hold my breath
Spirv generated is not valid when nonuniformEXT is used in ternary condition or even if/else condition. Issue happens when nonuniformEXT is used for the texture index. If nonuniformEXT is used for the sampler, then the spirv is generated correctly. But according to Vulkan spec https://github.com/KhronosGroup/GLSL/blob/main/extensions/ext/GL_EXT_nonuniform_qualifier.txt nonuniformEXT can be used for local variables as well.
GLSL
Command line
Decompile spirv using spirv-cross
Resulting GLSL has no nonuniformEXT instructions