Skip to content

Commit

Permalink
[dxvk] Remove ability to query instance from adapter
Browse files Browse the repository at this point in the history
Adapters don't hold a reference to the instance.
  • Loading branch information
doitsujin committed Nov 8, 2019
1 parent 77574d9 commit a74449c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
13 changes: 3 additions & 10 deletions src/dxvk/dxvk_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
9 changes: 1 addition & 8 deletions src/dxvk/dxvk_adapter.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace dxvk {
public:

DxvkAdapter(
DxvkInstance* instance,
const Rc<vk::InstanceFn>& vki,
VkPhysicalDevice handle);
~DxvkAdapter();

Expand All @@ -82,12 +82,6 @@ namespace dxvk {
return m_handle;
}

/**
* \brief Vulkan instance
* \returns Vulkan instance
*/
Rc<DxvkInstance> instance() const;

/**
* \brief Physical device properties
*
Expand Down Expand Up @@ -257,7 +251,6 @@ namespace dxvk {

private:

DxvkInstance* m_instance;
Rc<vk::InstanceFn> m_vki;
VkPhysicalDevice m_handle;

Expand Down
2 changes: 1 addition & 1 deletion src/dxvk/dxvk_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a74449c

Please sign in to comment.