1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 01:24:11 +01:00

[dxvk] Remove ability to query instance from adapter

Adapters don't hold a reference to the instance.
This commit is contained in:
Philip Rebohle 2019-11-08 11:28:08 +01:00
parent 77574d9970
commit a74449c367
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 5 additions and 19 deletions

View File

@ -8,10 +8,9 @@
namespace dxvk { namespace dxvk {
DxvkAdapter::DxvkAdapter( DxvkAdapter::DxvkAdapter(
DxvkInstance* instance, const Rc<vk::InstanceFn>& vki,
VkPhysicalDevice handle) VkPhysicalDevice handle)
: m_instance (instance), : m_vki (vki),
m_vki (instance->vki()),
m_handle (handle) { m_handle (handle) {
this->initHeapAllocInfo(); this->initHeapAllocInfo();
this->queryExtensions(); this->queryExtensions();
@ -28,11 +27,6 @@ namespace dxvk {
} }
Rc<DxvkInstance> DxvkAdapter::instance() const {
return m_instance;
}
DxvkAdapterMemoryInfo DxvkAdapter::getMemoryHeapInfo() const { DxvkAdapterMemoryInfo DxvkAdapter::getMemoryHeapInfo() const {
VkPhysicalDeviceMemoryBudgetPropertiesEXT memBudget = { }; VkPhysicalDeviceMemoryBudgetPropertiesEXT memBudget = { };
memBudget.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT; 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_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_TRANSFER_BIT,
VK_QUEUE_TRANSFER_BIT); VK_QUEUE_TRANSFER_BIT);
if (transferQueue == VK_QUEUE_FAMILY_IGNORED if (transferQueue == VK_QUEUE_FAMILY_IGNORED)
|| !m_instance->options().enableTransferQueue)
transferQueue = graphicsQueue; transferQueue = graphicsQueue;
DxvkAdapterQueueIndices queues; DxvkAdapterQueueIndices queues;

View File

@ -62,7 +62,7 @@ namespace dxvk {
public: public:
DxvkAdapter( DxvkAdapter(
DxvkInstance* instance, const Rc<vk::InstanceFn>& vki,
VkPhysicalDevice handle); VkPhysicalDevice handle);
~DxvkAdapter(); ~DxvkAdapter();
@ -82,12 +82,6 @@ namespace dxvk {
return m_handle; return m_handle;
} }
/**
* \brief Vulkan instance
* \returns Vulkan instance
*/
Rc<DxvkInstance> instance() const;
/** /**
* \brief Physical device properties * \brief Physical device properties
* *
@ -257,7 +251,6 @@ namespace dxvk {
private: private:
DxvkInstance* m_instance;
Rc<vk::InstanceFn> m_vki; Rc<vk::InstanceFn> m_vki;
VkPhysicalDevice m_handle; VkPhysicalDevice m_handle;

View File

@ -157,7 +157,7 @@ namespace dxvk {
std::vector<Rc<DxvkAdapter>> result; std::vector<Rc<DxvkAdapter>> result;
for (uint32_t i = 0; i < numAdapters; i++) { for (uint32_t i = 0; i < numAdapters; i++) {
Rc<DxvkAdapter> adapter = new DxvkAdapter(this, adapters[i]); Rc<DxvkAdapter> adapter = new DxvkAdapter(m_vki, adapters[i]);
if (filter.testAdapter(adapter)) if (filter.testAdapter(adapter))
result.push_back(adapter); result.push_back(adapter);