anv: Properly enumerate physical devices when none are present
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 14 Mar 2017 02:30:26 +0000 (19:30 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 14 Mar 2017 16:08:07 +0000 (09:08 -0700)
src/intel/vulkan/anv_device.c

index d8eafb98ee31e34effd2a1a2baa6f25c6e3542aa..5d1bbf608592bf835d86c5dbb95761657463e202 100644 (file)
@@ -412,8 +412,11 @@ VkResult anv_EnumeratePhysicalDevices(
       }
    }
 
-   vk_outarray_append(&out, i) {
-      *i = anv_physical_device_to_handle(&instance->physicalDevice);
+   if (instance->physicalDeviceCount > 0) {
+      assert(instance->physicalDeviceCount == 1);
+      vk_outarray_append(&out, i) {
+         *i = anv_physical_device_to_handle(&instance->physicalDevice);
+      }
    }
 
    return vk_outarray_status(&out);