diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 5165f78749..eae1c11ce7 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h @@ -118,17 +118,10 @@ TextureCache
::TextureCache(Runtime& runtime_, Tegra::MaxwellDeviceMemoryManag
template ::RunGarbageCollector() {
- bool high_priority_mode = false;
+ bool high_priority_mode = total_used_memory >= expected_memory;
bool aggressive_mode = false;
- u64 ticks_to_destroy = 0;
- size_t num_iterations = 0;
-
- const auto Configure = [&](bool allow_aggressive) {
- high_priority_mode = total_used_memory >= expected_memory;
- aggressive_mode = allow_aggressive && total_used_memory >= critical_memory;
- ticks_to_destroy = aggressive_mode ? 10ULL : high_priority_mode ? 25ULL : 50ULL;
- num_iterations = aggressive_mode ? 40 : (high_priority_mode ? 20 : 10);
- };
+ u64 ticks_to_destroy = high_priority_mode ? 25ULL : 50ULL;
+ size_t num_iterations = high_priority_mode ? 20 : 10;
const auto Cleanup = [this, &num_iterations, &high_priority_mode,
&aggressive_mode](ImageId image_id) {
@@ -145,12 +138,9 @@ void TextureCache ::RunGarbageCollector() {
}
if (True(image.flags & ImageFlagBits::IsDecoding)) {
- // This image is still being decoded, deleting it will invalidate the slot
- // used by the async decoder thread.
return false;
}
- // Prioritize large sparse textures for cleanup
const bool is_large_sparse = lowmemorydevice &&
image.info.is_sparse &&
image.guest_size_bytes >= 256_MiB;
@@ -183,7 +173,6 @@ void TextureCache ::RunGarbageCollector() {
if (total_used_memory < critical_memory) {
if (aggressive_mode) {
- // Sink the aggresiveness.
num_iterations >>= 2;
aggressive_mode = false;
return false;
@@ -196,55 +185,53 @@ void TextureCache ::RunGarbageCollector() {
return false;
};
- const auto CollectBelow = [this](u64 threshold) {
- boost::container::small_vector