vk/device: Use an array for device extensions
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 1 Sep 2015 23:44:42 +0000 (16:44 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 5 Sep 2015 00:55:42 +0000 (17:55 -0700)
src/vulkan/anv_device.c

index 70c0c9d490ac30636f3016dc929e9899a4da3f8b..25fedf908b8ff9562eab2b27591734c8604adc61 100644 (file)
@@ -657,6 +657,9 @@ VkResult anv_GetGlobalExtensionProperties(
    return VK_SUCCESS;
 }
 
+static const VkExtensionProperties device_extensions[] = {
+};
+
 VkResult anv_GetPhysicalDeviceExtensionProperties(
     VkPhysicalDevice                            physicalDevice,
     const char*                                 pLayerName,
@@ -664,12 +667,16 @@ VkResult anv_GetPhysicalDeviceExtensionProperties(
     VkExtensionProperties*                      pProperties)
 {
    if (pProperties == NULL) {
-      *pCount = 0;
+      *pCount = ARRAY_SIZE(device_extensions);
       return VK_SUCCESS;
    }
 
-   /* None supported at this time */
-   return vk_error(VK_ERROR_INVALID_EXTENSION);
+   assert(*pCount < ARRAY_SIZE(device_extensions));
+
+   *pCount = ARRAY_SIZE(device_extensions);
+   memcpy(pProperties, device_extensions, sizeof(device_extensions));
+
+   return VK_SUCCESS;
 }
 
 VkResult anv_GetGlobalLayerProperties(