From 191bba660bb8376715bf32d7432c0ddd40824990 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 28 Jun 2019 00:20:38 +0200 Subject: [PATCH] [dxvk] Provide way to access queue properties from device --- src/d3d11/d3d11_interop.cpp | 2 +- src/d3d11/d3d11_swapchain.cpp | 2 +- src/dxvk/dxvk_device.h | 21 +++++++++++++++------ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/d3d11/d3d11_interop.cpp b/src/d3d11/d3d11_interop.cpp index f54c49e33..98c5f4574 100644 --- a/src/d3d11/d3d11_interop.cpp +++ b/src/d3d11/d3d11_interop.cpp @@ -60,7 +60,7 @@ namespace dxvk { VkQueue* pQueue, uint32_t* pQueueFamilyIndex) { auto device = static_cast(m_device)->GetDXVKDevice(); - DxvkDeviceQueue queue = device->graphicsQueue(); + DxvkDeviceQueue queue = device->queues().graphics; if (pQueue != nullptr) *pQueue = queue.queueHandle; diff --git a/src/d3d11/d3d11_swapchain.cpp b/src/d3d11/d3d11_swapchain.cpp index bffb82105..2beb2574b 100644 --- a/src/d3d11/d3d11_swapchain.cpp +++ b/src/d3d11/d3d11_swapchain.cpp @@ -330,7 +330,7 @@ namespace dxvk { void D3D11SwapChain::CreatePresenter() { - DxvkDeviceQueue graphicsQueue = m_device->graphicsQueue(); + DxvkDeviceQueue graphicsQueue = m_device->queues().graphics; vk::PresenterDevice presenterDevice; presenterDevice.queueFamily = graphicsQueue.queueFamily; diff --git a/src/dxvk/dxvk_device.h b/src/dxvk/dxvk_device.h index 235f5e6e5..bf254eb8a 100644 --- a/src/dxvk/dxvk_device.h +++ b/src/dxvk/dxvk_device.h @@ -111,14 +111,23 @@ namespace dxvk { } /** - * \brief Graphics queue properties + * \brief Queue handles * - * Handle and queue family index of - * the queue used for rendering. - * \returns Graphics queue info + * Handles and queue family indices + * of all known device queues. + * \returns Device queue infos */ - DxvkDeviceQueue graphicsQueue() const { - return m_queues.graphics; + const DxvkDeviceQueueSet& queues() const { + return m_queues; + } + + /** + * \brief Tests whether a dedicated transfer queue is available + * \returns \c true if an SDMA queue is supported by the device + */ + bool hasDedicatedTransferQueue() const { + return m_queues.transfer.queueHandle + != m_queues.graphics.queueHandle; } /**