From 2e980353d2e85820b259fac1038a0a02675df714 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Fri, 12 Feb 2021 08:36:58 +0100 Subject: [PATCH] anv: Allow null handle in DestroyDescriptorUpdateTemplate. By the Vulkan specification, and similarly to many other Vulkan calls, it is allowed to destroy a null descriptor update template. Signed-off-by: Giovanni Mascellani Fixes: af5f13e58c9dfe ("anv: add VK_KHR_descriptor_update_template support") Reviewed-by: Lionel Landwerlin Part-of: (cherry picked from commit 72b8e643b0232dfcdcbc9f071c410653bc10d079) --- .pick_status.json | 2 +- src/intel/vulkan/anv_descriptor_set.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index e2b254b4be7..12904f71f0e 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3478,7 +3478,7 @@ "description": "anv: Allow null handle in DestroyDescriptorUpdateTemplate.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "af5f13e58c9dfe3a54487a3b002370c1edd39cf3" }, diff --git a/src/intel/vulkan/anv_descriptor_set.c b/src/intel/vulkan/anv_descriptor_set.c index e3895a77234..a8d91b36ed0 100644 --- a/src/intel/vulkan/anv_descriptor_set.c +++ b/src/intel/vulkan/anv_descriptor_set.c @@ -1805,6 +1805,9 @@ void anv_DestroyDescriptorUpdateTemplate( ANV_FROM_HANDLE(anv_descriptor_update_template, template, descriptorUpdateTemplate); + if (!template) + return; + vk_object_base_finish(&template->base); vk_free2(&device->vk.alloc, pAllocator, template); }