Mesa (master): lavapipe: ignore templateType when descriptor template isn't for push descriptors

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Mar 28 19:30:29 UTC 2021


Module: Mesa
Branch: master
Commit: 71ebcf30e4e380ad49edb54d72fa68f9f7d32688
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=71ebcf30e4e380ad49edb54d72fa68f9f7d32688

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Fri Mar 26 08:09:26 2021 -0400

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 at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9853>

---

 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);



More information about the mesa-commit mailing list