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>
This commit is contained in:
Giovanni Mascellani
2021-02-12 08:36:58 +01:00
committed by Marge Bot
parent 82981ccbb1
commit 72b8e643b0

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