Skip to content

[SPIR-V] Array containing a Block or BufferBlock must not be decorated with ArrayStride #8023

@Raikiri

Description

@Raikiri

Description
Having an array of read-write structured buffers and passing one of them into a function produces the following error upon loading the shader module:
validation layer: vkCreateShaderModule(): pCreateInfo->pCode (spirv-val produced an error): Array containing a Block or BufferBlock must not be decorated with ArrayStride %_arr_type_ACSBuffer_counter_uint_7 = OpTypeArray %type_ACSBuffer_counter %uint_7 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://docs.vulkan.org/spec/latest/chapters/shaders.html#VUID-VkShaderModuleCreateInfo-pCode-08737)

Steps to Reproduce

[[vk::binding(0, 0)]]
RWStructuredBuffer<uint> bufs[7];
void Func(RWStructuredBuffer<uint> buf)
{
}

void main()
{
  Func(bufs[0]);
}

Might be related to this? #7867

Environment

  • DXC version libdxcompiler.so: 1.8(dev;0-00000000); libdxil.so: 1.8
  • Host Operating System NixOS 2.28.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug, regression, crashneeds-triageAwaiting triagespirvWork related to SPIR-V

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions