diff options
author | Jason Ekstrand <jason@jlekstrand.net> | 2020-04-21 11:29:21 -0500 |
---|---|---|
committer | Dylan Baker <dylan.c.baker@intel.com> | 2020-05-04 10:21:09 -0700 |
commit | ac5cb6a66c8faf63443993c84d6cf85aac93d3eb (patch) | |
tree | 7dead5f2cfb8f5efb5b3ea8f415ca35df793f94d | |
parent | 52f1498321d81d278c472e4719f0437866d8cbb8 (diff) |
vulkan: Allow destroying NULL debug report callbacks
Fixes: 086cfa5652 "anv: implementation of VK_EXT_debug_report extension"
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Kristian H. Kristensen <hoegsberg@google.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4690>
(cherry picked from commit 9d10bde5a878aac440ea34dfb304812cd00b231c)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/vulkan/util/vk_debug_report.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/.pick_status.json b/.pick_status.json index 9b7f9f57a2e..378e937b727 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -373,7 +373,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; |