summaryrefslogtreecommitdiff
path: root/src/video_core/buffer_cache
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2021-06-14 13:42:22 +0200
committerGravatar Fernando Sahmkow2021-06-16 21:35:03 +0200
commit0dd98842bf87bdd0735d187f8d183ef7593ad747 (patch)
tree9198ce2e52bb44cef14ee2f6da76d4995c73c852 /src/video_core/buffer_cache
parentReaper: Setup settings and final tuning. (diff)
downloadyuzu-0dd98842bf87bdd0735d187f8d183ef7593ad747.tar.gz
yuzu-0dd98842bf87bdd0735d187f8d183ef7593ad747.tar.xz
yuzu-0dd98842bf87bdd0735d187f8d183ef7593ad747.zip
Reaper: Address Feedback.
Diffstat (limited to 'src/video_core/buffer_cache')
-rw-r--r--src/video_core/buffer_cache/buffer_cache.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h
index a8fb21d92..82a4a10d6 100644
--- a/src/video_core/buffer_cache/buffer_cache.h
+++ b/src/video_core/buffer_cache/buffer_cache.h
@@ -16,6 +16,7 @@
16 16
17#include <boost/container/small_vector.hpp> 17#include <boost/container/small_vector.hpp>
18 18
19#include "common/common_sizes.h"
19#include "common/common_types.h" 20#include "common/common_types.h"
20#include "common/div_ceil.h" 21#include "common/div_ceil.h"
21#include "common/microprofile.h" 22#include "common/microprofile.h"
@@ -65,8 +66,8 @@ class BufferCache {
65 66
66 static constexpr BufferId NULL_BUFFER_ID{0}; 67 static constexpr BufferId NULL_BUFFER_ID{0};
67 68
68 static constexpr u64 expected_memory = 512ULL * 1024ULL * 1024ULL; 69 static constexpr u64 EXPECTED_MEMORY = Common::Size_512_MB;
69 static constexpr u64 critical_memory = 1024ULL * 1024ULL * 1024ULL; 70 static constexpr u64 CRITICAL_MEMORY = Common::Size_1_GB;
70 71
71 using Maxwell = Tegra::Engines::Maxwell3D::Regs; 72 using Maxwell = Tegra::Engines::Maxwell3D::Regs;
72 73
@@ -368,13 +369,13 @@ void BufferCache<P>::TickFrame() {
368 const bool skip_preferred = hits * 256 < shots * 251; 369 const bool skip_preferred = hits * 256 < shots * 251;
369 uniform_buffer_skip_cache_size = skip_preferred ? DEFAULT_SKIP_CACHE_SIZE : 0; 370 uniform_buffer_skip_cache_size = skip_preferred ? DEFAULT_SKIP_CACHE_SIZE : 0;
370 371
371 const bool activate_gc = enabled_gc && total_used_memory >= expected_memory; 372 const bool activate_gc = enabled_gc && total_used_memory >= EXPECTED_MEMORY;
372 if (!activate_gc) { 373 if (!activate_gc) {
373 return; 374 return;
374 } 375 }
375 const bool agressive_gc = total_used_memory >= critical_memory; 376 const bool aggressive_gc = total_used_memory >= CRITICAL_MEMORY;
376 const u64 ticks_to_destroy = agressive_gc ? 60 : 120; 377 const u64 ticks_to_destroy = aggressive_gc ? 60 : 120;
377 int num_iterations = agressive_gc ? 64 : 32; 378 int num_iterations = aggressive_gc ? 64 : 32;
378 for (; num_iterations > 0; --num_iterations) { 379 for (; num_iterations > 0; --num_iterations) {
379 if (deletion_iterator == slot_buffers.end()) { 380 if (deletion_iterator == slot_buffers.end()) {
380 deletion_iterator = slot_buffers.begin(); 381 deletion_iterator = slot_buffers.begin();