summaryrefslogtreecommitdiff
path: root/vulkan/libvulkan/api.cpp
diff options
context:
space:
mode:
authorChia-I Wu <olv@google.com>2016-04-27 09:54:02 +0800
committerChia-I Wu <olv@google.com>2016-04-28 08:52:42 +0800
commit04c6551eb812a7efe38fa74e6ac67c17aab3df2d (patch)
tree22366643413b2fe84c740bbff99981671a9b53ce /vulkan/libvulkan/api.cpp
parent25700b452535ce7ae838bfe832392b46ed555ed2 (diff)
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
Diffstat (limited to 'vulkan/libvulkan/api.cpp')
-rw-r--r--vulkan/libvulkan/api.cpp18
1 files changed, 16 insertions, 2 deletions
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;