From b27a2ba4fcb07d0d55e237f6d62c8dd69e0f1380 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: --- src/vulkan/runtime/vk_debug_report.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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); }