Skip to content

Commit

Permalink
[dxvk] Do not always keep an empty chunk around
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
doitsujin committed Sep 24, 2024
1 parent cde3fd8 commit 6247d31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dxvk/dxvk_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,11 +524,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);
}

Expand Down

0 comments on commit 6247d31

Please sign in to comment.