summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_core/texture_cache/texture_cache.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index 6ee654dc1..e7f8478b4 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -344,6 +344,7 @@ private:
344 344
345 bool has_deleted_images = false; 345 bool has_deleted_images = false;
346 u64 total_used_memory = 0; 346 u64 total_used_memory = 0;
347 u64 minimum_memory;
347 u64 expected_memory; 348 u64 expected_memory;
348 u64 critical_memory; 349 u64 critical_memory;
349 350
@@ -396,10 +397,12 @@ TextureCache<P>::TextureCache(Runtime& runtime_, VideoCore::RasterizerInterface&
396 const u64 possible_critical_memory = (device_memory * 6) / 10; 397 const u64 possible_critical_memory = (device_memory * 6) / 10;
397 expected_memory = std::max(possible_expected_memory, DEFAULT_EXPECTED_MEMORY); 398 expected_memory = std::max(possible_expected_memory, DEFAULT_EXPECTED_MEMORY);
398 critical_memory = std::max(possible_critical_memory, DEFAULT_CRITICAL_MEMORY); 399 critical_memory = std::max(possible_critical_memory, DEFAULT_CRITICAL_MEMORY);
400 minimum_memory = 0;
399 } else { 401 } else {
400 // on OGL we can be more conservatives as the driver takes care. 402 // on OGL we can be more conservatives as the driver takes care.
401 expected_memory = DEFAULT_EXPECTED_MEMORY + Common::Size_512_MB; 403 expected_memory = DEFAULT_EXPECTED_MEMORY + Common::Size_512_MB;
402 critical_memory = DEFAULT_CRITICAL_MEMORY + Common::Size_1_GB; 404 critical_memory = DEFAULT_CRITICAL_MEMORY + Common::Size_1_GB;
405 minimum_memory = expected_memory;
403 } 406 }
404} 407}
405 408
@@ -470,7 +473,7 @@ void TextureCache<P>::RunGarbageCollector() {
470 473
471template <class P> 474template <class P>
472void TextureCache<P>::TickFrame() { 475void TextureCache<P>::TickFrame() {
473 if (Settings::values.use_caches_gc.GetValue()) { 476 if (Settings::values.use_caches_gc.GetValue() && total_used_memory > minimum_memory) {
474 RunGarbageCollector(); 477 RunGarbageCollector();
475 } 478 }
476 sentenced_images.Tick(); 479 sentenced_images.Tick();