Mesa (master): anv: Unify GetDeviceQueue and GetDeviceQueue2

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Nov 11 16:15:10 UTC 2019


Module: Mesa
Branch: master
Commit: 20b403aad0db5dda579de9ff31c38906b277d364
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=20b403aad0db5dda579de9ff31c38906b277d364

Author: Ricardo Garcia <rgarcia at igalia.com>
Date:   Thu Nov  7 15:38:45 2019 +0100

anv: Unify GetDeviceQueue and GetDeviceQueue2

Avoid duplicating some checks and code by making anv_GetDeviceQueue a
subcase of anv_GetDeviceQueue2, like radv does.

Signed-off-by: Ricardo Garcia <rgarcia at igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/intel/vulkan/anv_device.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 381b7ab3c41..ea1fcea82d9 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -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(




More information about the mesa-commit mailing list