From a6eba403e2a2274c8aca62a59a206fc583134b4d Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 5 Oct 2015 21:17:12 -0700 Subject: [PATCH] vk/0.170.2: Update to the new queue family properties query --- include/vulkan/vulkan.h | 15 +++++---------- src/vulkan/anv_device.c | 21 ++++++++------------- 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index 9cee1c545b6..69decf94ce6 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -1294,7 +1294,7 @@ typedef struct { VkQueueFlags queueFlags; uint32_t queueCount; VkBool32 supportsTimestamps; -} VkPhysicalDeviceQueueProperties; +} VkQueueFamilyProperties; typedef struct { VkMemoryPropertyFlags propertyFlags; @@ -2074,8 +2074,7 @@ typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceFormatProperties)(VkPhysicalDevi typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageFormatProperties* pImageFormatProperties); typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceLimits)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceLimits* pLimits); typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties); -typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceQueueCount)(VkPhysicalDevice physicalDevice, uint32_t* pCount); -typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceQueueProperties)(VkPhysicalDevice physicalDevice, uint32_t count, VkPhysicalDeviceQueueProperties* pQueueProperties); +typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceQueueFamilyProperties)(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkQueueFamilyProperties* pQueueFamilyProperties); typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceMemoryProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties); typedef PFN_vkVoidFunction (VKAPI *PFN_vkGetInstanceProcAddr)(VkInstance instance, const char* pName); typedef PFN_vkVoidFunction (VKAPI *PFN_vkGetDeviceProcAddr)(VkDevice device, const char* pName); @@ -2257,14 +2256,10 @@ VkResult VKAPI vkGetPhysicalDeviceProperties( VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties); -VkResult VKAPI vkGetPhysicalDeviceQueueCount( +VkResult VKAPI vkGetPhysicalDeviceQueueFamilyProperties( VkPhysicalDevice physicalDevice, - uint32_t* pCount); - -VkResult VKAPI vkGetPhysicalDeviceQueueProperties( - VkPhysicalDevice physicalDevice, - uint32_t count, - VkPhysicalDeviceQueueProperties* pQueueProperties); + uint32_t* pCount, + VkQueueFamilyProperties* pQueueFamilyProperties); VkResult VKAPI vkGetPhysicalDeviceMemoryProperties( VkPhysicalDevice physicalDevice, diff --git a/src/vulkan/anv_device.c b/src/vulkan/anv_device.c index dd8e3ffa0af..31b7565b984 100644 --- a/src/vulkan/anv_device.c +++ b/src/vulkan/anv_device.c @@ -451,23 +451,18 @@ VkResult anv_GetPhysicalDeviceProperties( return VK_SUCCESS; } -VkResult anv_GetPhysicalDeviceQueueCount( +VkResult anv_GetPhysicalDeviceQueueFamilyProperties( VkPhysicalDevice physicalDevice, - uint32_t* pCount) + uint32_t* pCount, + VkQueueFamilyProperties* pQueueFamilyProperties) { - *pCount = 1; - - return VK_SUCCESS; -} + if (pQueueFamilyProperties == NULL) { + *pCount = 1; + } -VkResult anv_GetPhysicalDeviceQueueProperties( - VkPhysicalDevice physicalDevice, - uint32_t count, - VkPhysicalDeviceQueueProperties* pQueueProperties) -{ - assert(count == 1); + assert(*pCount >= 1); - *pQueueProperties = (VkPhysicalDeviceQueueProperties) { + *pQueueFamilyProperties = (VkQueueFamilyProperties) { .queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_DMA_BIT, -- 2.30.2