From 04c6551eb812a7efe38fa74e6ac67c17aab3df2d Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 27 Apr 2016 09:54:02 +0800 Subject: vulkan: refactor layer extension enumeration Replace Get*LayerExtensions by a set of new functions that do not distinguish instance and device layers. There should be no user-visible change. Bug: 27911856 Change-Id: Icd98abf51a936769f8f2f218794043b5e2611c5c --- vulkan/libvulkan/api.cpp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'vulkan/libvulkan/api.cpp') diff --git a/vulkan/libvulkan/api.cpp b/vulkan/libvulkan/api.cpp index e3f69fea82..6d558eec80 100644 --- a/vulkan/libvulkan/api.cpp +++ b/vulkan/libvulkan/api.cpp @@ -1123,7 +1123,14 @@ VkResult EnumerateInstanceExtensionProperties( if (pLayerName) { const VkExtensionProperties* props; uint32_t count; - GetInstanceLayerExtensions(pLayerName, &props, &count); + + const Layer* layer = FindLayer(pLayerName); + if (layer) { + props = GetLayerInstanceExtensions(*layer, count); + } else { + props = nullptr; + count = 0; + } if (!pProperties || *pPropertyCount > count) *pPropertyCount = count; @@ -1181,7 +1188,14 @@ VkResult EnumerateDeviceExtensionProperties( if (pLayerName) { const VkExtensionProperties* props; uint32_t count; - GetDeviceLayerExtensions(pLayerName, &props, &count); + + const Layer* layer = FindLayer(pLayerName); + if (layer && IsLayerGlobal(*layer)) { + props = GetLayerDeviceExtensions(*layer, count); + } else { + props = nullptr; + count = 0; + } if (!pProperties || *pPropertyCount > count) *pPropertyCount = count; -- cgit v1.2.3-59-g8ed1b