I have a fairly simple HLSL shader that is being compiled into SPIR-V using DirectxShaderCompiler. Though, using scalar layout causes validation layer error. I have enabled the VK_EXT_SCALAR_BLOCK_LAYOUT_EXTENSION_NAME
extension while creating the VkDevice. Is it a validation layer, or dxc bug or do I require an additional flag to generate SPIR-V?
Command to generate SPIR-V:
COMMAND $ENV{VULKAN_SDK}/bin/dxc -spirv -fvk-use-scalar-layout -fvk-invert-y -T vs_6_0 -E ${vertexEntry} ${file} -Fo ${CMAKE_SOURCE_DIR}/Assets/${vertexEntry}.spv
Validation layer error:
Validation Error: [ UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle = 0x1e320175dc0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 | SPIR-V module not valid: Structure id 7 decorated as BufferBlock for variable in Uniform storage class must follow relaxed storage buffer layout rules: member 1 is an improperly straddling vector at offset 12
%Vertex = OpTypeStruct %v3float %v3float %v2float