turnip: Fix result of vkEnumerate*ExtensionProperties
authorChad Versace <chadversary@chromium.org>
Wed, 7 Nov 2018 07:01:03 +0000 (00:01 -0700)
committerChia-I Wu <olvaffe@gmail.com>
Mon, 11 Mar 2019 17:01:33 +0000 (10:01 -0700)
Given an unsupported layer name, the functions must return
VK_ERROR_LAYER_NOT_PRESENT.

src/freedreno/vulkan/tu_device.c

index b3ea522bfdf25733615dcde15d9b4932bd942b78..bee0a66d746b1ba3556fab2d9d9e8566e0b35543 100644 (file)
@@ -1176,6 +1176,10 @@ tu_EnumerateInstanceExtensionProperties(const char *pLayerName,
 {
    VK_OUTARRAY_MAKE(out, pProperties, pPropertyCount);
 
+   /* We spport no lyaers */
+   if (pLayerName)
+      return vk_error(NULL, VK_ERROR_LAYER_NOT_PRESENT);
+
    for (int i = 0; i < TU_INSTANCE_EXTENSION_COUNT; i++) {
       if (tu_supported_instance_extensions.extensions[i]) {
          vk_outarray_append(&out, prop) { *prop = tu_instance_extensions[i]; }
@@ -1191,9 +1195,14 @@ tu_EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice,
                                       uint32_t *pPropertyCount,
                                       VkExtensionProperties *pProperties)
 {
+   /* We spport no lyaers */
    TU_FROM_HANDLE(tu_physical_device, device, physicalDevice);
    VK_OUTARRAY_MAKE(out, pProperties, pPropertyCount);
 
+   /* We spport no lyaers */
+   if (pLayerName)
+      return vk_error(NULL, VK_ERROR_LAYER_NOT_PRESENT);
+
    for (int i = 0; i < TU_DEVICE_EXTENSION_COUNT; i++) {
       if (device->supported_extensions.extensions[i]) {
          vk_outarray_append(&out, prop) { *prop = tu_device_extensions[i]; }