radv: return count of queue families written
authorDamien Grassart <damien@grassart.com>
Sat, 24 Dec 2016 23:41:45 +0000 (00:41 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 25 Dec 2016 01:25:02 +0000 (02:25 +0100)
The Vulkan spec indicates that
vkGetPhysicalDeviceQueueFamilyProperties() should overwrite
pQueueFamilyPropertyCount with the number of structures actually
written to pQueueFamilyProperties.

Signed-off-by: Damien Grassart <damien@grassart.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_device.c

index 47be5f743f53f6cf0cd80662d40fe8cf444d7b0a..dcbb01547e732d122fb14c34ea400d6573e1f6a0 100644 (file)
@@ -583,8 +583,10 @@ void radv_GetPhysicalDeviceQueueFamilyProperties(
                idx++;
        }
 
-       if (!all_queues)
+       if (!all_queues) {
+               *pCount = idx;
                return;
+       }
 
        if (pdevice->rad_info.compute_rings > 0 && pdevice->rad_info.chip_class >= CIK) {
                if (*pCount > idx) {
@@ -597,6 +599,7 @@ void radv_GetPhysicalDeviceQueueFamilyProperties(
                        idx++;
                }
        }
+       *pCount = idx;
 }
 
 void radv_GetPhysicalDeviceMemoryProperties(