summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-03-13 19:30:26 -0700
committerJason Ekstrand <[email protected]>2017-03-14 09:08:07 -0700
commitaed27141452ab894ba62358e6a88fd681eff09c7 (patch)
tree743c3ab29cd6f724e70c4fc185977c017491d2c4 /src/intel/vulkan
parent9d559ba39dca49c30cdfc81e8fdfbefb06a05f2a (diff)
anv: Properly enumerate physical devices when none are present
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r--src/intel/vulkan/anv_device.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index d8eafb98ee3..5d1bbf60859 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -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);