From 71ebcf30e4e380ad49edb54d72fa68f9f7d32688 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 26 Mar 2021 08:09:26 -0400 Subject: [PATCH] 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 Part-of: --- src/gallium/frontends/lavapipe/lvp_descriptor_set.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/frontends/lavapipe/lvp_descriptor_set.c b/src/gallium/frontends/lavapipe/lvp_descriptor_set.c index 18de5bf6baf..7daf88f3877 100644 --- a/src/gallium/frontends/lavapipe/lvp_descriptor_set.c +++ b/src/gallium/frontends/lavapipe/lvp_descriptor_set.c @@ -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);