Mesa (staging/21.0): anv: Allow null handle in DestroyDescriptorUpdateTemplate.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Feb 18 21:04:19 UTC 2021
Module: Mesa
Branch: staging/21.0
Commit: 2e980353d2e85820b259fac1038a0a02675df714
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2e980353d2e85820b259fac1038a0a02675df714
Author: Giovanni Mascellani <gmascellani at codeweavers.com>
Date: Fri Feb 12 08:36:58 2021 +0100
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 at codeweavers.com>
Fixes: af5f13e58c9dfe ("anv: add VK_KHR_descriptor_update_template support")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9005>
(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);
}
More information about the mesa-commit
mailing list