Mesa (main): vulkan: explicitly cast object-type enum

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 19 07:30:54 UTC 2022


Module: Mesa
Branch: main
Commit: b27a2ba4fcb07d0d55e237f6d62c8dd69e0f1380
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b27a2ba4fcb07d0d55e237f6d62c8dd69e0f1380

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Thu Mar 24 09:57:10 2022 +0100

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 <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15547>

---

 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);
 }



More information about the mesa-commit mailing list