From f272071d8df5ebd2245f97e8942143687235e3e5 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 14 Mar 2019 16:47:17 +0100 Subject: [PATCH] [dxvk] Don't enforce HOST_CACHED flag when allocating memory The better fix would be to support non-coherent memory properly, but this will have to do for now. Fixes #947. --- src/dxvk/dxvk_memory.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/dxvk/dxvk_memory.cpp b/src/dxvk/dxvk_memory.cpp index a36544c2c..d3d859270 100644 --- a/src/dxvk/dxvk_memory.cpp +++ b/src/dxvk/dxvk_memory.cpp @@ -186,10 +186,13 @@ namespace dxvk { float priority) { std::lock_guard lock(m_mutex); - DxvkMemory result = this->tryAlloc(req, dedAllocInfo, flags, priority); + VkMemoryPropertyFlags optFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT + | VK_MEMORY_PROPERTY_HOST_CACHED_BIT; - if (!result && (flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT)) - result = this->tryAlloc(req, dedAllocInfo, flags & ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, priority); + DxvkMemory result = this->tryAlloc(req, dedAllocInfo, flags, priority); + + if (!result && (flags & optFlags)) + result = this->tryAlloc(req, dedAllocInfo, flags & ~optFlags, priority); if (!result) { Logger::err(str::format(