Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binding Array of Uniform Buffer Improperly Annotated Block #6733

Open
Tracked by #3637
cwfitzgerald opened this issue Dec 14, 2024 · 0 comments
Open
Tracked by #3637

Binding Array of Uniform Buffer Improperly Annotated Block #6733

cwfitzgerald opened this issue Dec 14, 2024 · 0 comments
Labels
area: naga back-end Outputs of naga shader conversion feature: bindless Issues with Bindless Native Feature lang: SPIR-V Vulkan's Shading Language naga Shader Translator type: bug Something isn't working

Comments

@cwfitzgerald
Copy link
Member

cwfitzgerald commented Dec 14, 2024

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.

@cwfitzgerald cwfitzgerald added type: bug Something isn't working area: naga back-end Outputs of naga shader conversion naga Shader Translator lang: SPIR-V Vulkan's Shading Language feature: bindless Issues with Bindless Native Feature labels Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga back-end Outputs of naga shader conversion feature: bindless Issues with Bindless Native Feature lang: SPIR-V Vulkan's Shading Language naga Shader Translator type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant