Skip to content

Binding Array of Uniform Buffer Improperly Annotated Block #6733

@cwfitzgerald

Description

@cwfitzgerald

The following code causes a spirv validation error:

struct ImAU32 {
    value: u32,
    _padding: u32,
    _padding2: u32,
    _padding3: u32,
};

@group(0) @binding(0)
var<uniform> buffers: binding_array<ImAU32>;

@group(0) @binding(1)
var<storage, read_write> output_buffer: array<u32>;

@compute
@workgroup_size(16, 1, 1)
fn compMain(@builtin(global_invocation_id) id: vec3u) {
    output_buffer[id.x] = buffers[id.x].value;
}
Validation Error: Validation Error: [ VUID-VkShaderModuleCreateInfo-pCode-08737 ] | MessageID = 0xa5625282 | vkCreateShaderModule(): pCreateInfo->pCode (spirv-val produced an error):
    [VUID-StandaloneSpirv-Uniform-06676] Uniform id '5' is missing Block or BufferBlock decoration.
    From Vulkan spec:
    Such variables must be identified with a Block or BufferBlock decoration
      %ImAU32 = OpTypeStruct %uint %uint %uint %uint
    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://vulkan.lunarg.com/doc/view/1.3.296.0/windows/1.3-extensions/vkspec.html#VUID-VkShaderModuleCreateInfo-pCode-08737)

See #6732's binding_array_uniform_buffers test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: naga back-endOutputs of naga shader conversionfeature: bindlessIssues with the Bindless Native Featurelang: SPIR-VVulkan's Shading LanguagenagaShader Translatortype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions