From 3a09abcce424a85f78168ab108ed0b161f665b44 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 25 Sep 2024 01:34:46 +0200 Subject: [PATCH] [dxvk] Do not always keep an empty chunk around Outdated thinking, we have a 20 second timer on this which should be more than enough to ensure we're not spamming device memory allocations. --- src/dxvk/dxvk_memory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dxvk/dxvk_memory.cpp b/src/dxvk/dxvk_memory.cpp index 51bc19f183c..c89627efe6a 100644 --- a/src/dxvk/dxvk_memory.cpp +++ b/src/dxvk/dxvk_memory.cpp @@ -531,11 +531,11 @@ namespace dxvk { } // Free chunks that have not been used in some time, but only free - // one chunk at a time and keep at least one empty chunk alive. + // one chunk per iteration. Reset the timer if we already freed one. if (!shouldFree && time != high_resolution_clock::time_point()) { if (chunk.unusedTime == high_resolution_clock::time_point() || chunkFreed) chunk.unusedTime = time; - else if (unusedMemory > chunk.memory.size) + else shouldFree = time - chunk.unusedTime >= std::chrono::seconds(20); }