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: 41318a5819 ("vulkan: Use vk_object_base::type for debug_report")
Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15547>
This commit is contained in:
Erik Faye-Lund 2022-03-24 09:57:10 +01:00 committed by Marge Bot
parent 90db834603
commit b27a2ba4fc
1 changed files with 4 additions and 3 deletions

View File

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