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.
This commit is contained in:
baldurk
2017-06-07 14:18:56 +01:00
parent 494427aac4
commit 2eb668eea8
@@ -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 ||