-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area: naga back-endOutputs of naga shader conversionOutputs of naga shader conversionfeature: bindlessIssues with the Bindless Native FeatureIssues with the Bindless Native Featurelang: SPIR-VVulkan's Shading LanguageVulkan's Shading LanguagenagaShader TranslatorShader Translatortype: bugSomething isn't workingSomething isn't working
Description
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
Labels
area: naga back-endOutputs of naga shader conversionOutputs of naga shader conversionfeature: bindlessIssues with the Bindless Native FeatureIssues with the Bindless Native Featurelang: SPIR-VVulkan's Shading LanguageVulkan's Shading LanguagenagaShader TranslatorShader Translatortype: bugSomething isn't workingSomething isn't working