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 <gmascellani@codeweavers.com>
Fixes: af5f13e58c ("anv: add VK_KHR_descriptor_update_template support")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9005>
(cherry picked from commit 72b8e643b0)
This commit is contained in:
Giovanni Mascellani 2021-02-12 08:36:58 +01:00 committed by Dylan Baker
parent 7ac677a051
commit 2e980353d2
2 changed files with 4 additions and 1 deletions

View file

@ -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"
},

View file

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