From 3b70e23e2c81e7ac7870e703523c82331a646c66 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 29 May 2018 14:56:41 +0200 Subject: [PATCH] [dxvk] Allow overcommitting non-device local memory If allocations on host-local memory types fail, we can rely on Vulkan's error reporting. May fix issues on systems with small amounts of VRAM. --- src/dxvk/dxvk_memory.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dxvk/dxvk_memory.cpp b/src/dxvk/dxvk_memory.cpp index ccfc13ea..2c0f524f 100644 --- a/src/dxvk/dxvk_memory.cpp +++ b/src/dxvk/dxvk_memory.cpp @@ -191,7 +191,7 @@ namespace dxvk { DxvkMemoryStats DxvkMemoryAllocator::getMemoryStats() { std::lock_guard lock(m_mutex); - + DxvkMemoryStats totalStats; for (size_t i = 0; i < m_memProps.memoryHeapCount; i++) { @@ -260,7 +260,8 @@ namespace dxvk { DxvkDeviceMemory DxvkMemoryAllocator::tryAllocDeviceMemory( DxvkMemoryType* type, VkDeviceSize size) { - if (type->heap->stats.memoryAllocated + size > type->heap->properties.size) + if ((type->memType.propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) + && (type->heap->stats.memoryAllocated + size > type->heap->properties.size)) return DxvkDeviceMemory(); DxvkDeviceMemory result;