diff options
| author | Courtney Goeltzenleuchter <courtneygo@google.com> | 2015-12-01 14:08:28 -0700 |
|---|---|---|
| committer | Jon Ashburn <jon@lunarg.com> | 2015-12-17 11:20:06 -0700 |
| commit | f5970c76038ae09ef457ecf8a239c50e86cd789e (patch) | |
| tree | 4cd3ec3eebfbe78deb48518900830f8cfc3bd2e0 /layers/swapchain.cpp | |
| parent | edcff401e235512af036e8949399df4ee1c4b48e (diff) | |
| download | usermoji-f5970c76038ae09ef457ecf8a239c50e86cd789e.tar.xz | |
layers: export debug_report extension
Need the EnumerateInstanceExtensionProperties to report
support for the debug report extension as well as in
the json file because different platforms will use either
the json file (Windows & Linux) or the Enumerate call (Android).
Diffstat (limited to 'layers/swapchain.cpp')
| -rw-r--r-- | layers/swapchain.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp index 2b8ed24c..609f44e6 100644 --- a/layers/swapchain.cpp +++ b/layers/swapchain.cpp @@ -41,6 +41,39 @@ template layer_data *get_my_data_ptr<layer_data>( void *data_key, std::unordered_map<void *, layer_data *> &data_map); +static const VkExtensionProperties instance_extensions[] = { + { + VK_EXT_LUNARG_DEBUG_REPORT_EXTENSION_NAME, + VK_EXT_LUNARG_DEBUG_REPORT_EXTENSION_REVISION + } +}; + +VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceExtensionProperties( + const char *pLayerName, + uint32_t *pCount, + VkExtensionProperties* pProperties) +{ + return util_GetExtensionProperties(1, instance_extensions, pCount, pProperties); +} + +static const VkLayerProperties swapchain_global_layers[] = { + { + "Swapchain", + VK_API_VERSION, + VK_MAKE_VERSION(0, 1, 0), + "Validation layer: Swapchain", + } +}; + +VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkEnumerateInstanceLayerProperties( + uint32_t *pCount, + VkLayerProperties* pProperties) +{ + return util_GetLayerProperties(ARRAY_SIZE(swapchain_global_layers), + swapchain_global_layers, + pCount, pProperties); +} + static void createDeviceRegisterExtensions(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, VkDevice device) { @@ -1204,6 +1237,11 @@ VK_LAYER_EXPORT VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL vkGetInstanceProcAddr(V return (PFN_vkVoidFunction) vkGetInstanceProcAddr; } + if (!strcmp(funcName, "vkEnumerateInstanceLayerProperties")) + return (PFN_vkVoidFunction) vkEnumerateInstanceLayerProperties; + if (!strcmp(funcName, "vkEnumerateInstanceExtensionProperties")) + return (PFN_vkVoidFunction) vkEnumerateInstanceExtensionProperties; + addr = layer_intercept_instance_proc(funcName); if (addr) return addr; |
