lavapipe: ignore templateType when descriptor template isn't for push descriptors

spec compliance requires this and validation may crash without it

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9853>
This commit is contained in:
Mike Blumenkrantz 2021-03-26 08:09:26 -04:00 committed by Marge Bot
parent c3bf3e8d43
commit 71ebcf30e4

View file

@ -561,7 +561,11 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateDescriptorUpdateTemplate(VkDevice _devi
templ->descriptor_set_layout = set_layout;
templ->bind_point = pCreateInfo->pipelineBindPoint;
templ->set = pCreateInfo->set;
templ->pipeline_layout = lvp_pipeline_layout_from_handle(pCreateInfo->pipelineLayout);
/* This parameter is ignored if templateType is not VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR */
if (pCreateInfo->templateType == VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR)
templ->pipeline_layout = lvp_pipeline_layout_from_handle(pCreateInfo->pipelineLayout);
else
templ->pipeline_layout = NULL;
templ->entry_count = entry_count;
VkDescriptorUpdateTemplateEntry *entries = (VkDescriptorUpdateTemplateEntry *)(templ + 1);