diff options
| author | 2023-05-31 12:36:04 -0400 | |
|---|---|---|
| committer | 2024-02-11 13:41:13 -0500 | |
| commit | 865a0186b6db97afed21db6ad924c9968b437265 (patch) | |
| tree | cf81630a8e2e7bd9028bc650b4de95ffa8e22da0 | |
| parent | Merge pull request #12986 from t895/input-config-clear-fix (diff) | |
| download | yuzu-865a0186b6db97afed21db6ad924c9968b437265.tar.gz yuzu-865a0186b6db97afed21db6ad924c9968b437265.tar.xz yuzu-865a0186b6db97afed21db6ad924c9968b437265.zip | |
caches: make critical reclamation less eager and possible in more cases
| -rw-r--r-- | src/video_core/buffer_cache/buffer_cache.h | 2 | ||||
| -rw-r--r-- | src/video_core/texture_cache/texture_cache.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 6d3d933c5..3818e00f4 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h | |||
| @@ -35,7 +35,7 @@ BufferCache<P>::BufferCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, R | |||
| 35 | const s64 min_spacing_critical = device_local_memory - 512_MiB; | 35 | const s64 min_spacing_critical = device_local_memory - 512_MiB; |
| 36 | const s64 mem_threshold = std::min(device_local_memory, TARGET_THRESHOLD); | 36 | const s64 mem_threshold = std::min(device_local_memory, TARGET_THRESHOLD); |
| 37 | const s64 min_vacancy_expected = (6 * mem_threshold) / 10; | 37 | const s64 min_vacancy_expected = (6 * mem_threshold) / 10; |
| 38 | const s64 min_vacancy_critical = (3 * mem_threshold) / 10; | 38 | const s64 min_vacancy_critical = (2 * mem_threshold) / 10; |
| 39 | minimum_memory = static_cast<u64>( | 39 | minimum_memory = static_cast<u64>( |
| 40 | std::max(std::min(device_local_memory - min_vacancy_expected, min_spacing_expected), | 40 | std::max(std::min(device_local_memory - min_vacancy_expected, min_spacing_expected), |
| 41 | DEFAULT_EXPECTED_MEMORY)); | 41 | DEFAULT_EXPECTED_MEMORY)); |
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index a20c956ff..3faff0c2f 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h | |||
| @@ -55,7 +55,7 @@ TextureCache<P>::TextureCache(Runtime& runtime_, Tegra::MaxwellDeviceMemoryManag | |||
| 55 | const s64 min_spacing_critical = device_local_memory - 512_MiB; | 55 | const s64 min_spacing_critical = device_local_memory - 512_MiB; |
| 56 | const s64 mem_threshold = std::min(device_local_memory, TARGET_THRESHOLD); | 56 | const s64 mem_threshold = std::min(device_local_memory, TARGET_THRESHOLD); |
| 57 | const s64 min_vacancy_expected = (6 * mem_threshold) / 10; | 57 | const s64 min_vacancy_expected = (6 * mem_threshold) / 10; |
| 58 | const s64 min_vacancy_critical = (3 * mem_threshold) / 10; | 58 | const s64 min_vacancy_critical = (2 * mem_threshold) / 10; |
| 59 | expected_memory = static_cast<u64>( | 59 | expected_memory = static_cast<u64>( |
| 60 | std::max(std::min(device_local_memory - min_vacancy_expected, min_spacing_expected), | 60 | std::max(std::min(device_local_memory - min_vacancy_expected, min_spacing_expected), |
| 61 | DEFAULT_EXPECTED_MEMORY)); | 61 | DEFAULT_EXPECTED_MEMORY)); |
| @@ -81,7 +81,6 @@ void TextureCache<P>::RunGarbageCollector() { | |||
| 81 | if (num_iterations == 0) { | 81 | if (num_iterations == 0) { |
| 82 | return true; | 82 | return true; |
| 83 | } | 83 | } |
| 84 | --num_iterations; | ||
| 85 | auto& image = slot_images[image_id]; | 84 | auto& image = slot_images[image_id]; |
| 86 | if (True(image.flags & ImageFlagBits::IsDecoding)) { | 85 | if (True(image.flags & ImageFlagBits::IsDecoding)) { |
| 87 | // This image is still being decoded, deleting it will invalidate the slot | 86 | // This image is still being decoded, deleting it will invalidate the slot |
| @@ -96,6 +95,7 @@ void TextureCache<P>::RunGarbageCollector() { | |||
| 96 | if (!high_priority_mode && must_download) { | 95 | if (!high_priority_mode && must_download) { |
| 97 | return false; | 96 | return false; |
| 98 | } | 97 | } |
| 98 | --num_iterations; | ||
| 99 | if (must_download) { | 99 | if (must_download) { |
| 100 | auto map = runtime.DownloadStagingBuffer(image.unswizzled_size_bytes); | 100 | auto map = runtime.DownloadStagingBuffer(image.unswizzled_size_bytes); |
| 101 | const auto copies = FullDownloadCopies(image.info); | 101 | const auto copies = FullDownloadCopies(image.info); |