vulkan: allow null descriptor set layouts in pipeline layouts

VK_NULL_HANDLE descriptor set layouts are allowed when creating pipeline
layouts without VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT.

From VUID-VkPipelineLayoutCreateInfo-graphicsPipelineLibrary-06753:

> If graphicsPipelineLibrary is not enabled, elements of pSetLayouts
> must be valid VkDescriptorSetLayout objects

From VUID-VkPipelineLayoutCreateInfo-pSetLayouts-parameter:

> If setLayoutCount is not 0, pSetLayouts must be a valid pointer to an
> array of setLayoutCount valid or VK_NULL_HANDLE VkDescriptorSetLayout
> handles

Signed-off-by: Ricardo Garcia <rgarcia@igalia.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17629>
This commit is contained in:
Ricardo Garcia 2022-07-20 12:13:53 +02:00 committed by Marge Bot
parent b54544852c
commit 4058984b63
1 changed files with 4 additions and 7 deletions

View File

@ -50,13 +50,10 @@ vk_pipeline_layout_init(struct vk_device *device,
VK_FROM_HANDLE(vk_descriptor_set_layout, set_layout,
pCreateInfo->pSetLayouts[s]);
if (set_layout == NULL) {
assert(layout->create_flags &
VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT);
continue;
}
layout->set_layouts[s] = vk_descriptor_set_layout_ref(set_layout);
if (set_layout != NULL)
layout->set_layouts[s] = vk_descriptor_set_layout_ref(set_layout);
else
layout->set_layouts[s] = NULL;
}
}