From: Nicolas Koch Date: Thu, 6 Oct 2016 19:21:32 +0000 (+0200) Subject: anv: Return correct result in EnumeratePhysicalDevices X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fd27d5fd92b0ea42854edc59768e2e04709e179a;p=mesa.git 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 Reviewed-by: Jason Ekstrand --- 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; }