summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan
diff options
context:
space:
mode:
authorNicolas Koch <nioko1337@gmail.com>2016-10-06 21:21:32 +0200
committerJason Ekstrand <jason.ekstrand@intel.com>2016-10-11 22:58:27 -0700
commitfd27d5fd92b0ea42854edc59768e2e04709e179a (patch)
tree9392cc932af33bcf8eb7c1fd46692bba3c7fda8d /src/intel/vulkan
parent2871d4d687710fb006dce11afa20a21f3f331180 (diff)
downloadexternal_mesa3d-fd27d5fd92b0ea42854edc59768e2e04709e179a.zip
external_mesa3d-fd27d5fd92b0ea42854edc59768e2e04709e179a.tar.gz
external_mesa3d-fd27d5fd92b0ea42854edc59768e2e04709e179a.tar.bz2
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>
Diffstat (limited to 'src/intel/vulkan')
-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 02246ba..24f7227 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;
}