mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxvk] Don't oversubscribe memory heaps on UMA devices
Otherwise, we seem to suffer a major performance penalty on setups with insufficient dedicated system memory.
This commit is contained in:
parent
3beca254e2
commit
ca4c03284f
@ -169,6 +169,8 @@ namespace dxvk {
|
|||||||
m_memTypes[i].memTypeId = i;
|
m_memTypes[i].memTypeId = i;
|
||||||
m_memTypes[i].chunkSize = pickChunkSize(i);
|
m_memTypes[i].chunkSize = pickChunkSize(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_restrictAllocations = m_device->isUnifiedMemoryArchitecture();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -309,6 +311,9 @@ namespace dxvk {
|
|||||||
bool useMemoryPriority = (flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)
|
bool useMemoryPriority = (flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)
|
||||||
&& (m_device->features().extMemoryPriority.memoryPriority);
|
&& (m_device->features().extMemoryPriority.memoryPriority);
|
||||||
|
|
||||||
|
if (m_restrictAllocations && type->heap->stats.memoryAllocated + size > type->heap->properties.size)
|
||||||
|
return DxvkDeviceMemory();
|
||||||
|
|
||||||
DxvkDeviceMemory result;
|
DxvkDeviceMemory result;
|
||||||
result.memSize = size;
|
result.memSize = size;
|
||||||
result.memFlags = flags;
|
result.memFlags = flags;
|
||||||
|
@ -284,6 +284,8 @@ namespace dxvk {
|
|||||||
std::mutex m_mutex;
|
std::mutex m_mutex;
|
||||||
std::array<DxvkMemoryHeap, VK_MAX_MEMORY_HEAPS> m_memHeaps;
|
std::array<DxvkMemoryHeap, VK_MAX_MEMORY_HEAPS> m_memHeaps;
|
||||||
std::array<DxvkMemoryType, VK_MAX_MEMORY_TYPES> m_memTypes;
|
std::array<DxvkMemoryType, VK_MAX_MEMORY_TYPES> m_memTypes;
|
||||||
|
|
||||||
|
bool m_restrictAllocations;
|
||||||
|
|
||||||
DxvkMemory tryAlloc(
|
DxvkMemory tryAlloc(
|
||||||
const VkMemoryRequirements* req,
|
const VkMemoryRequirements* req,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user