summaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorNicolas Koch <[email protected]>2016-10-06 21:21:32 +0200
committerJason Ekstrand <[email protected]>2016-10-11 22:58:27 -0700
commitfd27d5fd92b0ea42854edc59768e2e04709e179a (patch)
tree9392cc932af33bcf8eb7c1fd46692bba3c7fda8d /src/intel
parent2871d4d687710fb006dce11afa20a21f3f331180 (diff)
anv: Return correct result in EnumeratePhysicalDevices
If pPhysicalDevices is too small for all physical devices, the driver must return VK_INCOMPLETE. Since only a single physical device is supported, this is only the case when pPhysicalDeviceCount == 0 && pPhysicalDevices != NULL. Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/vulkan/anv_device.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 02246ba8e8a..24f7227aa81 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -385,6 +385,8 @@ VkResult anv_EnumeratePhysicalDevices(
} else if (*pPhysicalDeviceCount >= 1) {
pPhysicalDevices[0] = anv_physical_device_to_handle(&instance->physicalDevice);
*pPhysicalDeviceCount = 1;
+ } else if (*pPhysicalDeviceCount < instance->physicalDeviceCount) {
+ return VK_INCOMPLETE;
} else {
*pPhysicalDeviceCount = 0;
}