Mesa (master): anv: Return correct result in EnumeratePhysicalDevices
Jason Ekstrand
jekstrand at kemper.freedesktop.org
Wed Oct 12 05:58:41 UTC 2016
Module: Mesa
Branch: master
Commit: fd27d5fd92b0ea42854edc59768e2e04709e179a
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fd27d5fd92b0ea42854edc59768e2e04709e179a
Author: Nicolas Koch <nioko1337 at gmail.com>
Date: Thu Oct 6 21:21:32 2016 +0200
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 at gmail.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
---
src/intel/vulkan/anv_device.c | 2 ++
1 file changed, 2 insertions(+)
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;
}
More information about the mesa-commit
mailing list