diff options
author | Bas Nieuwenhuizen <[email protected]> | 2017-02-10 21:23:04 +0100 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2017-02-13 00:18:19 +0100 |
commit | 1811ccf1256662ae5d0c2b6f26916e8369497d1d (patch) | |
tree | 1f818d1388766da72e10be8a8b1b8eb9578b0823 /src | |
parent | 55e00c7cfe704a430606bc415a259a2cc827fa40 (diff) |
radv: Fix radv_GetPhysicalDeviceQueueFamilyProperties2KHR.
The struct have different size, so the arrays have different stride.
Signed-off-by: Bas Nieuwenhuizen <[email protected]>
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/amd/vulkan/radv_device.c | 45 |
1 files changed, 36 insertions, 9 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 8a54a2ad03b..fff31259028 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -623,12 +623,11 @@ void radv_GetPhysicalDeviceProperties2KHR( return radv_GetPhysicalDeviceProperties(physicalDevice, &pProperties->properties); } -void radv_GetPhysicalDeviceQueueFamilyProperties( - VkPhysicalDevice physicalDevice, +static void radv_get_physical_device_queue_family_properties( + struct radv_physical_device* pdevice, uint32_t* pCount, - VkQueueFamilyProperties* pQueueFamilyProperties) + VkQueueFamilyProperties** pQueueFamilyProperties) { - RADV_FROM_HANDLE(radv_physical_device, pdevice, physicalDevice); int num_queue_families = 1; int idx; if (pdevice->rad_info.compute_rings > 0 && @@ -646,7 +645,7 @@ void radv_GetPhysicalDeviceQueueFamilyProperties( idx = 0; if (*pCount >= 1) { - pQueueFamilyProperties[idx] = (VkQueueFamilyProperties) { + *pQueueFamilyProperties[idx] = (VkQueueFamilyProperties) { .queueFlags = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT, @@ -661,7 +660,7 @@ void radv_GetPhysicalDeviceQueueFamilyProperties( pdevice->rad_info.chip_class >= CIK && !(pdevice->instance->debug_flags & RADV_DEBUG_NO_COMPUTE_QUEUE)) { if (*pCount > idx) { - pQueueFamilyProperties[idx] = (VkQueueFamilyProperties) { + *pQueueFamilyProperties[idx] = (VkQueueFamilyProperties) { .queueFlags = VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT, .queueCount = pdevice->rad_info.compute_rings, .timestampValidBits = 64, @@ -673,14 +672,42 @@ void radv_GetPhysicalDeviceQueueFamilyProperties( *pCount = idx; } +void radv_GetPhysicalDeviceQueueFamilyProperties( + VkPhysicalDevice physicalDevice, + uint32_t* pCount, + VkQueueFamilyProperties* pQueueFamilyProperties) +{ + RADV_FROM_HANDLE(radv_physical_device, pdevice, physicalDevice); + if (!pQueueFamilyProperties) { + return radv_get_physical_device_queue_family_properties(pdevice, pCount, NULL); + return; + } + VkQueueFamilyProperties *properties[] = { + pQueueFamilyProperties + 0, + pQueueFamilyProperties + 1, + pQueueFamilyProperties + 2, + }; + radv_get_physical_device_queue_family_properties(pdevice, pCount, properties); + assert(*pCount <= 3); +} + void radv_GetPhysicalDeviceQueueFamilyProperties2KHR( VkPhysicalDevice physicalDevice, uint32_t* pCount, VkQueueFamilyProperties2KHR *pQueueFamilyProperties) { - return radv_GetPhysicalDeviceQueueFamilyProperties(physicalDevice, - pCount, - &pQueueFamilyProperties->queueFamilyProperties); + RADV_FROM_HANDLE(radv_physical_device, pdevice, physicalDevice); + if (!pQueueFamilyProperties) { + return radv_get_physical_device_queue_family_properties(pdevice, pCount, NULL); + return; + } + VkQueueFamilyProperties *properties[] = { + &pQueueFamilyProperties[0].queueFamilyProperties, + &pQueueFamilyProperties[1].queueFamilyProperties, + &pQueueFamilyProperties[2].queueFamilyProperties, + }; + radv_get_physical_device_queue_family_properties(pdevice, pCount, properties); + assert(*pCount <= 3); } void radv_GetPhysicalDeviceMemoryProperties( |