Closed ghost closed 7 years ago
This is being clarified in the VK_KHX_multiview spec that "The variable decorated with code:ViewIndex must: be declared using the code:Input storage class."
Is it also correct then that these are
in int gl_ViewIndex;
in int gl_DeviceIndex;
so that they map to the input storage class in SPIR-V? They were added to glslang as uniform
.
I think the in
vs. uniform
distinction would now be a spec. modification, if anything, as that shouldn't break GLSL content, but is needed to get correct SPIR-V content. Hence, that's addressed by 7a44a31.
They are already defined as "in" in the GLSL spec. See https://www.khronos.org/registry/vulkan/specs/misc/GL_EXT_device_group.txt https://www.khronos.org/registry/vulkan/specs/misc/GL_EXT_multiview.txt
Okay, everything should be good now then, closing.
Actually, those specs leave the storage qualifier off and don't say where to add them. They say to add them to the built-ins, but not where, or whether they are in in/out blocks, etc. They do refer to them as input variables, but it's not enough resolution to know how to add them.
I think this delta needs to be described against the 4.50 specification.
I reverted this until knowing more about it, and also to see what impact it had on the test bot.
c08fb8ab9c0d3aeafe11a8eeeed177c882ef76a9 correctly implements what the extension is supposed to say. Updated extensions will be published in the future. Main point is the variables are in (Input SPIR-V), and only device index is available in compute shaders.
glslang generates following SPIR-V for ViewIndex builld-in from multiview EXT:
However the Vulkan spec says:
My reading of above is the variable storage should be 'Input', not 'UniformConstant'