Mesa (staging/20.1): vulkan: Allow destroying NULL debug report callbacks
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue May 5 16:57:07 UTC 2020
Module: Mesa
Branch: staging/20.1
Commit: 86629193f5d33d3d7f2488696a9d99914886d527
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=86629193f5d33d3d7f2488696a9d99914886d527
Author: Jason Ekstrand <jason at jlekstrand.net>
Date: Tue Apr 21 11:29:21 2020 -0500
vulkan: Allow destroying NULL debug report callbacks
Fixes: 086cfa5652 "anv: implementation of VK_EXT_debug_report extension"
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Acked-by: Kristian H. Kristensen <hoegsberg at google.com>
Acked-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4690>
(cherry picked from commit 9d10bde5a878aac440ea34dfb304812cd00b231c)
---
.pick_status.json | 2 +-
src/vulkan/util/vk_debug_report.c | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/.pick_status.json b/.pick_status.json
index b2e0d1a2560..f44f8a8705f 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -526,7 +526,7 @@
"description": "vulkan: Allow destroying NULL debug report callbacks",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "086cfa5652ec202f87c14d11e0f6c959d75987d8"
},
diff --git a/src/vulkan/util/vk_debug_report.c b/src/vulkan/util/vk_debug_report.c
index c4884b963e0..78dcfa6e218 100644
--- a/src/vulkan/util/vk_debug_report.c
+++ b/src/vulkan/util/vk_debug_report.c
@@ -77,6 +77,9 @@ vk_destroy_debug_report_callback(struct vk_debug_report_instance *instance,
const VkAllocationCallbacks* pAllocator,
const VkAllocationCallbacks* instance_allocator)
{
+ if (_callback == VK_NULL_HANDLE)
+ return;
+
struct vk_debug_report_callback *callback =
(struct vk_debug_report_callback *)(uintptr_t)_callback;
More information about the mesa-commit
mailing list