So I'm trying to write three float4x4 matrices defined in a struct to a VolatileConstantBuffer every frame, that VolatileConstantBuffer is within the nvrhi::IBindingSet and nvrhi::IBindingLayout given to nvrhi::IGraphicsPipeline and nvrhi::GraphicsState respectively, but whenever I create the nvrhi::IGraphicsPipeline I get the following Vulkan Validation error:
Validation Error: [ VUID-VkGraphicsPipelineCreateInfo-layout-07988 ] | MessageID = 0x215f02cd
vkCreateGraphicsPipelines(): pCreateInfos[0].pStages[0] SPIR-V (VK_SHADER_STAGE_VERTEX_BIT) uses descriptor [Set 0, Binding 0, variable "CB"] (type VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC or VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK or VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER) but was not declared in the pipeline layout.
The Vulkan spec states: If a resource variable is declared in a shader, the corresponding descriptor set in layout must match the shader stage (https://vulkan.lunarg.com/doc/view/1.4.321.1/windows/antora/spec/latest/chapters/pipelines.html#VUID-VkGraphicsPipelineCreateInfo-layout-07988)
Objects: 2
[0] VkShaderModule 0xf000000000f
[1] VkPipelineLayout 0x1f000000001f
Any subsequent commandList->draw(drawArgs); or commandList->drawIndexed(drawArgs); yield a similar validation error, yet this time related to the VolatileConstantBuffer binding and set being invalid.
I use slangc to compile my shaders to spv code.
Not sure if this only happens with VolatileConstantBuffers since I havent tested other kinds of data.
I have the code in a repository, which I will provide upon request.
So I'm trying to write three
float4x4matrices defined in a struct to aVolatileConstantBufferevery frame, thatVolatileConstantBufferis within thenvrhi::IBindingSetandnvrhi::IBindingLayoutgiven tonvrhi::IGraphicsPipelineandnvrhi::GraphicsStaterespectively, but whenever I create thenvrhi::IGraphicsPipelineI get the following Vulkan Validation error:Any subsequent
commandList->draw(drawArgs);orcommandList->drawIndexed(drawArgs);yield a similar validation error, yet this time related to theVolatileConstantBufferbinding and set being invalid.I use
slangcto compile my shaders to spv code.Not sure if this only happens with
VolatileConstantBuffers since I havent tested other kinds of data.I have the code in a repository, which I will provide upon request.