1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-05 01:24:14 +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) DxvkMemoryAllocator::DxvkMemoryAllocator(const DxvkDevice* device)
: m_vkd (device->vkd()), : m_vkd (device->vkd()),
m_adapter (device->adapter()), m_device (device),
m_devProps (m_adapter->deviceProperties()), m_devProps (device->adapter()->deviceProperties()),
m_memProps (m_adapter->memoryProperties()), m_memProps (device->adapter()->memoryProperties()),
m_allowOvercommit (device->config().allowMemoryOvercommit) { m_allowOvercommit (device->config().allowMemoryOvercommit) {
for (uint32_t i = 0; i < m_memProps.memoryHeapCount; i++) { for (uint32_t i = 0; i < m_memProps.memoryHeapCount; i++) {
VkDeviceSize heapSize = m_memProps.memoryHeaps[i].size; VkDeviceSize heapSize = m_memProps.memoryHeaps[i].size;
@ -322,7 +322,7 @@ namespace dxvk {
} }
type->heap->stats.memoryAllocated += size; type->heap->stats.memoryAllocated += size;
m_adapter->notifyHeapMemoryAlloc(type->heapId, size); m_device->adapter()->notifyHeapMemoryAlloc(type->heapId, size);
return result; return result;
} }
@ -362,7 +362,7 @@ namespace dxvk {
DxvkDeviceMemory memory) { DxvkDeviceMemory memory) {
m_vkd->vkFreeMemory(m_vkd->device(), memory.memHandle, nullptr); m_vkd->vkFreeMemory(m_vkd->device(), memory.memHandle, nullptr);
type->heap->stats.memoryAllocated -= memory.memSize; 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: private:
const Rc<vk::DeviceFn> m_vkd; const Rc<vk::DeviceFn> m_vkd;
const Rc<DxvkAdapter> m_adapter; const DxvkDevice* m_device;
const VkPhysicalDeviceProperties m_devProps; const VkPhysicalDeviceProperties m_devProps;
const VkPhysicalDeviceMemoryProperties m_memProps; const VkPhysicalDeviceMemoryProperties m_memProps;
const bool m_allowOvercommit; const bool m_allowOvercommit;