diff options
author | Nicolas Koch <[email protected]> | 2016-10-12 13:55:46 +0200 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2016-10-13 09:11:13 +1000 |
commit | 35e2bfa6d912ad3ef57195b0e8f31f21eb64678e (patch) | |
tree | 802b2c7e4e32f0bdf1d8f60dff6f688e8e3b3e45 /src/amd/vulkan/radv_device.c | |
parent | e6a693c447213b578f562edad8f15ccc43056acd (diff) |
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 <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_device.c')
-rw-r--r-- | src/amd/vulkan/radv_device.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 6e06863f8ea..71b1481a5ae 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; } |