From: Samuel Pitoiset Date: Fri, 20 Dec 2019 12:30:28 +0000 (+0100) Subject: radv: rely on pipeline layout when creating push descriptors with template X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=02dd1fb859e8979dfb0232bad9291efc367b3b63;p=mesa.git radv: rely on pipeline layout when creating push descriptors with template descriptorSetLayout should be ignored for push descriptors. While we are it, also ignore pipelineBindPoint. Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2210 Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Tested-by: Marge Bot Part-of: --- diff --git a/src/amd/vulkan/radv_descriptor_set.c b/src/amd/vulkan/radv_descriptor_set.c index 051a51cdbe1..8a6f2fc2121 100644 --- a/src/amd/vulkan/radv_descriptor_set.c +++ b/src/amd/vulkan/radv_descriptor_set.c @@ -1153,7 +1153,18 @@ VkResult radv_CreateDescriptorUpdateTemplate(VkDevice _device, return vk_error(device->instance, VK_ERROR_OUT_OF_HOST_MEMORY); templ->entry_count = entry_count; - templ->bind_point = pCreateInfo->pipelineBindPoint; + + if (pCreateInfo->templateType == VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR) { + RADV_FROM_HANDLE(radv_pipeline_layout, pipeline_layout, pCreateInfo->pipelineLayout); + + /* descriptorSetLayout should be ignored for push descriptors + * and instead it refers to pipelineLayout and set. + */ + assert(pCreateInfo->set < MAX_SETS); + set_layout = pipeline_layout->set[pCreateInfo->set].layout; + + templ->bind_point = pCreateInfo->pipelineBindPoint; + } for (i = 0; i < entry_count; i++) { const VkDescriptorUpdateTemplateEntry *entry = &pCreateInfo->pDescriptorUpdateEntries[i];