1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-01 16:24:12 +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 {
DxvkAdapter::DxvkAdapter(
DxvkInstance* instance,
const Rc<vk::InstanceFn>& 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<DxvkInstance> 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;

View File

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

View File

@ -157,7 +157,7 @@ namespace dxvk {
std::vector<Rc<DxvkAdapter>> result;
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))
result.push_back(adapter);