From 4e20a87ae0a53c6b566c2b3a88040c7811e9c165 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Thu, 24 Mar 2022 09:57:10 +0100 Subject: [PATCH] vulkan: explicitly cast object-type enum VkObjectType and VkDebugReportObjectTypeEXT has the same enum-values. Why the Vulkan WG thought this was a good idea, beats me. But it's what we have to live with now. Anyway, instead of having a statement that implicitly casts two different values from the former to the latter, let's fully relsove the type as the former, and cast the value when using it instead. Fixes: 41318a58196 ("vulkan: Use vk_object_base::type for debug_report") Acked-by: Alyssa Rosenzweig Part-of: (cherry picked from commit b27a2ba4fcb07d0d55e237f6d62c8dd69e0f1380) --- .pick_status.json | 2 +- src/vulkan/runtime/vk_debug_report.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index e3190d5a04d..95bb19934a4 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1164,7 +1164,7 @@ "description": "vulkan: explicitly cast object-type enum", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "because_sha": "41318a58196d385ce97041e16a055baf892e38cb" }, { diff --git a/src/vulkan/runtime/vk_debug_report.c b/src/vulkan/runtime/vk_debug_report.c index db89e3d6f5d..ea9aebf5930 100644 --- a/src/vulkan/runtime/vk_debug_report.c +++ b/src/vulkan/runtime/vk_debug_report.c @@ -150,8 +150,9 @@ vk_debug_report(struct vk_instance *instance, const char* pLayerPrefix, const char *pMessage) { - VkDebugReportObjectTypeEXT object_type = + VkObjectType object_type = object ? object->type : VK_OBJECT_TYPE_UNKNOWN; - debug_report(instance, flags, object_type, (uint64_t)(uintptr_t)object, - location, messageCode, pLayerPrefix, pMessage); + debug_report(instance, flags, (VkDebugReportObjectTypeEXT)object_type, + (uint64_t)(uintptr_t)object, location, messageCode, + pLayerPrefix, pMessage); }