summaryrefslogtreecommitdiff
path: root/src/video_core/texture_cache
diff options
context:
space:
mode:
authorGravatar Fernando S2023-05-24 03:58:49 +0200
committerGravatar GitHub2023-05-24 03:58:49 +0200
commit72a14a68177a7ecab4d36fbaf8533cf4e0d70566 (patch)
treee18073ddf2049fb08d86a23db7445b6baacc2554 /src/video_core/texture_cache
parentMerge pull request #10417 from liamwhite/check-state (diff)
parentvideo_core: tune garbage collection aggressiveness (diff)
downloadyuzu-72a14a68177a7ecab4d36fbaf8533cf4e0d70566.tar.gz
yuzu-72a14a68177a7ecab4d36fbaf8533cf4e0d70566.tar.xz
yuzu-72a14a68177a7ecab4d36fbaf8533cf4e0d70566.zip
Merge pull request #10422 from liamwhite/gc
video_core: tune garbage collection aggressiveness
Diffstat (limited to 'src/video_core/texture_cache')
-rw-r--r--src/video_core/texture_cache/texture_cache.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index 8e62a5f78..9790949f5 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -49,8 +49,8 @@ TextureCache<P>::TextureCache(Runtime& runtime_, VideoCore::RasterizerInterface&
49 49
50 if constexpr (HAS_DEVICE_MEMORY_INFO) { 50 if constexpr (HAS_DEVICE_MEMORY_INFO) {
51 const s64 device_memory = static_cast<s64>(runtime.GetDeviceLocalMemory()); 51 const s64 device_memory = static_cast<s64>(runtime.GetDeviceLocalMemory());
52 const s64 min_spacing_expected = device_memory - 1_GiB - 512_MiB; 52 const s64 min_spacing_expected = device_memory - 1_GiB;
53 const s64 min_spacing_critical = device_memory - 1_GiB; 53 const s64 min_spacing_critical = device_memory - 512_MiB;
54 const s64 mem_threshold = std::min(device_memory, TARGET_THRESHOLD); 54 const s64 mem_threshold = std::min(device_memory, TARGET_THRESHOLD);
55 const s64 min_vacancy_expected = (6 * mem_threshold) / 10; 55 const s64 min_vacancy_expected = (6 * mem_threshold) / 10;
56 const s64 min_vacancy_critical = (3 * mem_threshold) / 10; 56 const s64 min_vacancy_critical = (3 * mem_threshold) / 10;
@@ -86,10 +86,12 @@ void TextureCache<P>::RunGarbageCollector() {
86 // used by the async decoder thread. 86 // used by the async decoder thread.
87 return false; 87 return false;
88 } 88 }
89 if (!aggressive_mode && True(image.flags & ImageFlagBits::CostlyLoad)) {
90 return false;
91 }
89 const bool must_download = 92 const bool must_download =
90 image.IsSafeDownload() && False(image.flags & ImageFlagBits::BadOverlap); 93 image.IsSafeDownload() && False(image.flags & ImageFlagBits::BadOverlap);
91 if (!high_priority_mode && 94 if (!high_priority_mode && must_download) {
92 (must_download || True(image.flags & ImageFlagBits::CostlyLoad))) {
93 return false; 95 return false;
94 } 96 }
95 if (must_download) { 97 if (must_download) {