You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Noticed this when upgrading to Vulkan SDK 1.3.290 from 1.3.280 that Vulkan-ValidationLayers, that includes SPIRV-Tools with #5695 merged, started warning about:
Expected Image to have the same type as Result Type Image
%20 = OpSampledImage %19 %13 %17
. The Vulkan spec states: If pCode is a pointer to SPIR-V code, pCode must adhere to the validation rules described by the Validation Rules within a Module section of the SPIR-V Environment appendix (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkShaderModuleCreateInfo-pCode-08737)
Passing a sampler to sampler2DShadow() is valid though? Looks like it when reading GLSL 4.60.8 specification section 5.4.5. Texture-Combined Sampler Constructors.
I think this comes down to the compiler (glslang in this case) not generating correct SPIR-V. Glslang should be declaring the image with a depth operand of either 1 or 2 in this case.
This is a bug in glslang codegen, being tracked in this glslang issue: KhronosGroup/glslang#3653
The GLSL construct is legal, it's just that the SPIR-V being generated by glslang is wrong.
I know too little about SPIR-V. I figured the OpTypeImage came (partly?) from the sampler. Changing to samplerShadow shadow_linear_compare_sampler makes it so depth is set to 1 (at least in the simple shader pasted above, not in the real shader code is copied from, which is weird).
But if this is something that can be fixed in glslang only, feel free to close this issue. :)
Noticed this when upgrading to Vulkan SDK 1.3.290 from 1.3.280 that Vulkan-ValidationLayers, that includes SPIRV-Tools with #5695 merged, started warning about:
Error log message:
Passing a
sampler
tosampler2DShadow()
is valid though? Looks like it when reading GLSL 4.60.8 specification section 5.4.5. Texture-Combined Sampler Constructors.Test for it in glslang: https://github.com/KhronosGroup/glslang/blob/592de6cf78e0fb359fc3e2854c9dc0f3cf6d4820/Test/vulkan.frag#L25
glslang commit that made it valid: KhronosGroup/glslang@7d4c9a0
glslang commit message links to: KhronosGroup/GLSL#22
Original VVL issue: KhronosGroup/Vulkan-ValidationLayers#8413
The text was updated successfully, but these errors were encountered: