From 25664c6194850280d375d58cec75e8af8346c25d Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 18 Mar 2022 09:48:41 -0500 Subject: [PATCH] vulkan: Add a 2 wrapper for vkGetPhysicalDeviceQueueFamilyProperties Reviewed-by: Boris Brezillon Part-of: --- src/vulkan/runtime/vk_physical_device.c | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/vulkan/runtime/vk_physical_device.c b/src/vulkan/runtime/vk_physical_device.c index e6504c88ec0..3fd79713f38 100644 --- a/src/vulkan/runtime/vk_physical_device.c +++ b/src/vulkan/runtime/vk_physical_device.c @@ -126,6 +126,37 @@ vk_common_GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, *pProperties = props2.properties; } +VKAPI_ATTR void VKAPI_CALL +vk_common_GetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, + uint32_t *pQueueFamilyPropertyCount, + VkQueueFamilyProperties *pQueueFamilyProperties) +{ + VK_FROM_HANDLE(vk_physical_device, pdevice, physicalDevice); + + if (!pQueueFamilyProperties) { + pdevice->dispatch_table.GetPhysicalDeviceQueueFamilyProperties2(physicalDevice, + pQueueFamilyPropertyCount, + NULL); + return; + } + + STACK_ARRAY(VkQueueFamilyProperties2, props2, *pQueueFamilyPropertyCount); + + for (unsigned i = 0; i < *pQueueFamilyPropertyCount; ++i) { + props2[i].sType = VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2; + props2[i].pNext = NULL; + } + + pdevice->dispatch_table.GetPhysicalDeviceQueueFamilyProperties2(physicalDevice, + pQueueFamilyPropertyCount, + props2); + + for (unsigned i = 0; i < *pQueueFamilyPropertyCount; ++i) + pQueueFamilyProperties[i] = props2[i].queueFamilyProperties; + + STACK_ARRAY_FINISH(props2); +} + VKAPI_ATTR void VKAPI_CALL vk_common_GetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties *pMemoryProperties)