From 4406905600de72360ae7e860d6deabd6aed2b1f8 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 30 Aug 2022 10:25:44 +0200 Subject: [PATCH] radv: allow null descriptor set layouts in pipeline layouts This is allowed by the Vulkan spec when GPL is used. Fixes dEQP-VK.pipeline.pipeline_library.graphics_library.misc.other.null_descriptor_set_in_monolithic_pipeline Signed-off-by: Samuel Pitoiset Reviewed-By: Mike Blumenkrantz Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/radv_cmd_buffer.c | 10 +--------- src/amd/vulkan/radv_descriptor_set.c | 8 +------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c index b4dd00fa631..9ca620a22f1 100644 --- a/src/amd/vulkan/radv_cmd_buffer.c +++ b/src/amd/vulkan/radv_cmd_buffer.c @@ -5081,16 +5081,8 @@ radv_CmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pi unsigned set_idx = i + firstSet; RADV_FROM_HANDLE(radv_descriptor_set, set, pDescriptorSets[i]); - if (!set) { - /* From the Vulkan spec 1.3.211: - * - * "VUID-vkCmdBindDescriptorSets-layout-06564 - * If layout was not created with VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT, each - * element of pDescriptorSets must be a valid VkDescriptorSet" - */ - assert(layout->independent_sets); + if (!set) continue; - } /* If the set is already bound we only need to update the * (potentially changed) dynamic offsets. */ diff --git a/src/amd/vulkan/radv_descriptor_set.c b/src/amd/vulkan/radv_descriptor_set.c index b74fd40b9e5..26f0a2f108d 100644 --- a/src/amd/vulkan/radv_descriptor_set.c +++ b/src/amd/vulkan/radv_descriptor_set.c @@ -564,14 +564,8 @@ radv_CreatePipelineLayout(VkDevice _device, const VkPipelineLayoutCreateInfo *pC for (uint32_t set = 0; set < pCreateInfo->setLayoutCount; set++) { RADV_FROM_HANDLE(radv_descriptor_set_layout, set_layout, pCreateInfo->pSetLayouts[set]); - /* From the Vulkan spec 1.3.211: - * - * "VUID-VkPipelineLayoutCreateInfo-flags-06562 - * If flags: does not include VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT, elements of - * pSetLayouts must be valid VkDescriptorSetLayout objects" - */ if (set_layout == NULL) { - assert(layout->independent_sets); + layout->set[set].layout = NULL; continue; }