| Issue |
183367
|
| Summary |
[HLSL][Buffers][Vulkan] Buffer declaration emitting `OpTypeArray` instead of `OpTypeRuntimeArray`
|
| Labels |
HLSL
|
| Assignees |
|
| Reporter |
joaosaffran
|
`RWBuffer` declaration emitting `OpTypeArray` instead of `OpTypeRuntimeArray`
Example: https://hlsl.godbolt.org/z/WhWM17hjE.
This issue is causing tests like: `Feature/ResourceArrays/unbounded-array-nuri.test` to emit the following error when running it through `spriv-val`:
```
Validation Error: [ VUID-VkComputePipelineCreateInfo-layout-07991 ] | MessageID = 0x3af3126a
vkCreateComputePipelines(): pCreateInfos[0].stage SPIR-V (VK_SHADER_STAGE_COMPUTE_BIT) uses descriptor [Set 0, Binding 0, variable "Buf"] which has an array size of 4294967295 in the SPIR-V but VkDescriptorSetLayoutBinding::descriptorCount of 8 which doesn't initialize all the elements (can be done with the runtimeDescriptorArray feature).
(VkDescriptorSetLayout from VkPipelineLayoutCreateInfo::pSetLayouts[0]).
The Vulkan spec states: If a resource variable is declared in a shader as an array and layout is not VK_NULL_HANDLE, the corresponding descriptor binding used to create layout must have a descriptorCount that is greater than or equal to the length of the array (https://docs.vulkan.org/spec/latest/chapters/pipelines.html#VUID-VkComputePipelineCreateInfo-layout-07991)
Objects: 2
[0] VkShaderModule 0x20000000002
[1] VkDescriptorSetLayout 0x250000000025
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs