anv: Unify GetDeviceQueue and GetDeviceQueue2
authorRicardo Garcia <rgarcia@igalia.com>
Thu, 7 Nov 2019 14:38:45 +0000 (15:38 +0100)
committerJason Ekstrand <jason@jlekstrand.net>
Mon, 11 Nov 2019 16:14:56 +0000 (16:14 +0000)
Avoid duplicating some checks and code by making anv_GetDeviceQueue a
subcase of anv_GetDeviceQueue2, like radv does.

Signed-off-by: Ricardo Garcia <rgarcia@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_device.c

index 381b7ab3c41fa1139779d8c49e457daea47bec7c..ea1fcea82d998164ef53aeb37c2e292df2f54cb5 100644 (file)
@@ -2848,11 +2848,15 @@ void anv_GetDeviceQueue(
     uint32_t                                    queueIndex,
     VkQueue*                                    pQueue)
 {
-   ANV_FROM_HANDLE(anv_device, device, _device);
-
-   assert(queueIndex == 0);
+   const VkDeviceQueueInfo2 info = {
+      .sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2,
+      .pNext = NULL,
+      .flags = 0,
+      .queueFamilyIndex = queueNodeIndex,
+      .queueIndex = queueIndex,
+   };
 
-   *pQueue = anv_queue_to_handle(&device->queue);
+   anv_GetDeviceQueue2(_device, &info, pQueue);
 }
 
 void anv_GetDeviceQueue2(