From 16efa405273a2f1270de0d18655031bda7fe1ced Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Wed, 28 Sep 2016 12:48:56 -0600 Subject: [PATCH] layers: Add VK_NV_external_memory_caps ext to OT Added GetPhysicalDeviceExternalImageFormatPropertiesNV API for the VK_NV_external_memory_capabilities extension to object_tracker. Change-Id: I36ab9a1656dbecbb2384ee173359968ea8e454eb --- layers/object_tracker.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/layers/object_tracker.cpp b/layers/object_tracker.cpp index 73f634d..65a6a6b 100644 --- a/layers/object_tracker.cpp +++ b/layers/object_tracker.cpp @@ -3642,6 +3642,26 @@ VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer } } +// VK_NV_external_memory_capabilities Extension +VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceExternalImageFormatPropertiesNV( + VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, + VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, + VkExternalImageFormatPropertiesNV *pExternalImageFormatProperties) { + + bool skip_call = false; + { + std::lock_guard lock(global_lock); + skip_call |= ValidateObject(physicalDevice, physicalDevice, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, false); + } + if (skip_call) { + return VK_ERROR_VALIDATION_FAILED_EXT; + } + VkResult result = get_dispatch_table(ot_instance_table_map, physicalDevice) + ->GetPhysicalDeviceExternalImageFormatPropertiesNV(physicalDevice, format, type, tiling, usage, flags, + externalHandleType, pExternalImageFormatProperties); + return result; +} + static inline PFN_vkVoidFunction InterceptCoreDeviceCommand(const char *name) { if (!name || name[0] != 'v' || name[1] != 'k') return NULL; @@ -3937,6 +3957,8 @@ static inline PFN_vkVoidFunction InterceptCoreInstanceCommand(const char *name) return (PFN_vkVoidFunction)EnumerateDeviceLayerProperties; if (!strcmp(name, "GetPhysicalDeviceSparseImageFormatProperties")) return (PFN_vkVoidFunction)GetPhysicalDeviceSparseImageFormatProperties; + if (!strcmp(name, "GetPhysicalDeviceExternalImageFormatPropertiesNV")) + return (PFN_vkVoidFunction)GetPhysicalDeviceExternalImageFormatPropertiesNV; return NULL; } -- 2.7.4