1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-12 13:08:50 +01:00

[dxvk] Store device instead of adapter in memory allocator

This commit is contained in:
Philip Rebohle 2019-01-30 13:13:46 +01:00
parent b884c56631
commit 03b488772d
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 6 additions and 6 deletions

View File

@ -154,9 +154,9 @@ namespace dxvk {
DxvkMemoryAllocator::DxvkMemoryAllocator(const DxvkDevice* device)
: m_vkd (device->vkd()),
m_adapter (device->adapter()),
m_devProps (m_adapter->deviceProperties()),
m_memProps (m_adapter->memoryProperties()),
m_device (device),
m_devProps (device->adapter()->deviceProperties()),
m_memProps (device->adapter()->memoryProperties()),
m_allowOvercommit (device->config().allowMemoryOvercommit) {
for (uint32_t i = 0; i < m_memProps.memoryHeapCount; i++) {
VkDeviceSize heapSize = m_memProps.memoryHeaps[i].size;
@ -322,7 +322,7 @@ namespace dxvk {
}
type->heap->stats.memoryAllocated += size;
m_adapter->notifyHeapMemoryAlloc(type->heapId, size);
m_device->adapter()->notifyHeapMemoryAlloc(type->heapId, size);
return result;
}
@ -362,7 +362,7 @@ namespace dxvk {
DxvkDeviceMemory memory) {
m_vkd->vkFreeMemory(m_vkd->device(), memory.memHandle, nullptr);
type->heap->stats.memoryAllocated -= memory.memSize;
m_adapter->notifyHeapMemoryFree(type->heapId, memory.memSize);
m_device->adapter()->notifyHeapMemoryFree(type->heapId, memory.memSize);
}

View File

@ -262,7 +262,7 @@ namespace dxvk {
private:
const Rc<vk::DeviceFn> m_vkd;
const Rc<DxvkAdapter> m_adapter;
const DxvkDevice* m_device;
const VkPhysicalDeviceProperties m_devProps;
const VkPhysicalDeviceMemoryProperties m_memProps;
const bool m_allowOvercommit;