From a74449c3673c76cdd9c52a888f04a75223922d00 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 8 Nov 2019 11:28:08 +0100 Subject: [PATCH] [dxvk] Remove ability to query instance from adapter Adapters don't hold a reference to the instance. --- src/dxvk/dxvk_adapter.cpp | 13 +++---------- src/dxvk/dxvk_adapter.h | 9 +-------- src/dxvk/dxvk_instance.cpp | 2 +- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/dxvk/dxvk_adapter.cpp b/src/dxvk/dxvk_adapter.cpp index 6566f16a..a7b01c52 100644 --- a/src/dxvk/dxvk_adapter.cpp +++ b/src/dxvk/dxvk_adapter.cpp @@ -8,10 +8,9 @@ namespace dxvk { DxvkAdapter::DxvkAdapter( - DxvkInstance* instance, + const Rc& vki, VkPhysicalDevice handle) - : m_instance (instance), - m_vki (instance->vki()), + : m_vki (vki), m_handle (handle) { this->initHeapAllocInfo(); this->queryExtensions(); @@ -28,11 +27,6 @@ namespace dxvk { } - Rc DxvkAdapter::instance() const { - return m_instance; - } - - DxvkAdapterMemoryInfo DxvkAdapter::getMemoryHeapInfo() const { VkPhysicalDeviceMemoryBudgetPropertiesEXT memBudget = { }; memBudget.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT; @@ -98,8 +92,7 @@ namespace dxvk { VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT, VK_QUEUE_TRANSFER_BIT); - if (transferQueue == VK_QUEUE_FAMILY_IGNORED - || !m_instance->options().enableTransferQueue) + if (transferQueue == VK_QUEUE_FAMILY_IGNORED) transferQueue = graphicsQueue; DxvkAdapterQueueIndices queues; diff --git a/src/dxvk/dxvk_adapter.h b/src/dxvk/dxvk_adapter.h index 3b94332f..5d49029f 100644 --- a/src/dxvk/dxvk_adapter.h +++ b/src/dxvk/dxvk_adapter.h @@ -62,7 +62,7 @@ namespace dxvk { public: DxvkAdapter( - DxvkInstance* instance, + const Rc& vki, VkPhysicalDevice handle); ~DxvkAdapter(); @@ -82,12 +82,6 @@ namespace dxvk { return m_handle; } - /** - * \brief Vulkan instance - * \returns Vulkan instance - */ - Rc instance() const; - /** * \brief Physical device properties * @@ -257,7 +251,6 @@ namespace dxvk { private: - DxvkInstance* m_instance; Rc m_vki; VkPhysicalDevice m_handle; diff --git a/src/dxvk/dxvk_instance.cpp b/src/dxvk/dxvk_instance.cpp index 8a27a015..8d1b17f8 100644 --- a/src/dxvk/dxvk_instance.cpp +++ b/src/dxvk/dxvk_instance.cpp @@ -157,7 +157,7 @@ namespace dxvk { std::vector> result; for (uint32_t i = 0; i < numAdapters; i++) { - Rc adapter = new DxvkAdapter(this, adapters[i]); + Rc adapter = new DxvkAdapter(m_vki, adapters[i]); if (filter.testAdapter(adapter)) result.push_back(adapter);