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 <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
Nicolas Koch
2016-10-06 21:21:32 +02:00
committed by Jason Ekstrand
parent 2871d4d687
commit fd27d5fd92

View File

@@ -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;
}