From 2eb668eea8bea9258c5fe2ba37b6f271d16a84c2 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 7 Jun 2017 14:18:56 +0100 Subject: [PATCH] Add a special case for naming/tagging VkSurfaceKHR * Since the record pointer is really just the native window handle and not actually a record. We don't care about names for surfaces as we don't replay them, so just do a special unwrap and pass it along. --- .../driver/vulkan/wrappers/vk_misc_funcs.cpp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp b/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp index 95861e96b..4cdd13456 100644 --- a/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp +++ b/renderdoc/driver/vulkan/wrappers/vk_misc_funcs.cpp @@ -1052,6 +1052,15 @@ VkResult WrappedVulkan::vkDebugMarkerSetObjectTagEXT(VkDevice device, { VkDebugMarkerObjectTagInfoEXT unwrapped = *pTagInfo; + // special case for VkSurfaceKHR - the record pointer is actually just the underlying native + // window handle, so instead we unwrap and call through. + if(unwrapped.objectType == VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT) + { + unwrapped.object = GetWrapped((VkSurfaceKHR)unwrapped.object)->real.handle; + + return ObjDisp(device)->DebugMarkerSetObjectTagEXT(device, &unwrapped); + } + if(unwrapped.objectType == VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT || unwrapped.objectType == VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT || unwrapped.objectType == VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT || @@ -1118,6 +1127,18 @@ VkResult WrappedVulkan::vkDebugMarkerSetObjectNameEXT(VkDevice device, VkDebugMarkerObjectNameInfoEXT unwrapped = *pNameInfo; + // special case for VkSurfaceKHR - the record pointer is actually just the underlying native + // window handle, so instead we unwrap and call through. + if(unwrapped.objectType == VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT) + { + unwrapped.object = GetWrapped((VkSurfaceKHR)unwrapped.object)->real.handle; + + if(ObjDisp(device)->DebugMarkerSetObjectNameEXT) + return ObjDisp(device)->DebugMarkerSetObjectNameEXT(device, &unwrapped); + + return VK_SUCCESS; + } + if(unwrapped.objectType == VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT || unwrapped.objectType == VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT || unwrapped.objectType == VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT ||