mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-11-29 19:24:10 +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].chunkSize = pickChunkSize(i);
|
||||
}
|
||||
|
||||
m_restrictAllocations = m_device->isUnifiedMemoryArchitecture();
|
||||
}
|
||||
|
||||
|
||||
@ -309,6 +311,9 @@ namespace dxvk {
|
||||
bool useMemoryPriority = (flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)
|
||||
&& (m_device->features().extMemoryPriority.memoryPriority);
|
||||
|
||||
if (m_restrictAllocations && type->heap->stats.memoryAllocated + size > type->heap->properties.size)
|
||||
return DxvkDeviceMemory();
|
||||
|
||||
DxvkDeviceMemory result;
|
||||
result.memSize = size;
|
||||
result.memFlags = flags;
|
||||
|
@ -284,6 +284,8 @@ namespace dxvk {
|
||||
std::mutex m_mutex;
|
||||
std::array<DxvkMemoryHeap, VK_MAX_MEMORY_HEAPS> m_memHeaps;
|
||||
std::array<DxvkMemoryType, VK_MAX_MEMORY_TYPES> m_memTypes;
|
||||
|
||||
bool m_restrictAllocations;
|
||||
|
||||
DxvkMemory tryAlloc(
|
||||
const VkMemoryRequirements* req,
|
||||
|
Loading…
Reference in New Issue
Block a user