From: Chad Versace Date: Tue, 27 Dec 2016 18:25:58 +0000 (-0800) Subject: anv: Handle vkGetPhysicalDeviceQueueFamilyProperties with count == 0 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d6545f234593fb00d02fdc07f9b2a803d2b569f6;p=mesa.git anv: Handle vkGetPhysicalDeviceQueueFamilyProperties with count == 0 The spec implicitly allows the incoming count to be 0. From the Vulkan 1.0.38 spec, Section 4.1 Physical Devices: If the value referenced by pQueueFamilyPropertyCount is not 0 [then do stuff]. Cc: mesa-stable@lists.freedesktop.org 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 037ef827e15..323cae40292 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -646,7 +646,14 @@ void anv_GetPhysicalDeviceQueueFamilyProperties( return; } - assert(*pCount >= 1); + /* The spec implicitly allows the incoming count to be 0. From the Vulkan + * 1.0.38 spec, Section 4.1 Physical Devices: + * + * If the value referenced by pQueueFamilyPropertyCount is not 0 [then + * do stuff]. + */ + if (*pCount == 0) + return; *pQueueFamilyProperties = (VkQueueFamilyProperties) { .queueFlags = VK_QUEUE_GRAPHICS_BIT |