Mesa (master): radv: Return correct result in EnumeratePhysicalDevices

Dave Airlie airlied at kemper.freedesktop.org
Wed Oct 12 23:11:20 UTC 2016


Module: Mesa
Branch: master
Commit: 35e2bfa6d912ad3ef57195b0e8f31f21eb64678e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=35e2bfa6d912ad3ef57195b0e8f31f21eb64678e

Author: Nicolas Koch <nioko1337 at gmail.com>
Date:   Wed Oct 12 13:55:46 2016 +0200

radv: 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.

Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/amd/vulkan/radv_device.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 6e06863..71b1481 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -295,6 +295,8 @@ VkResult radv_EnumeratePhysicalDevices(
 	} else if (*pPhysicalDeviceCount >= 1) {
 		pPhysicalDevices[0] = radv_physical_device_to_handle(&instance->physicalDevice);
 		*pPhysicalDeviceCount = 1;
+	} else if (*pPhysicalDeviceCount < instance->physicalDeviceCount) {
+		return VK_INCOMPLETE;
 	} else {
 		*pPhysicalDeviceCount = 0;
 	}




More information about the mesa-commit mailing list