refactor(settings): simplify GC aggressiveness to Off/Light only

Remove Moderate, Heavy, and Extreme GC aggressiveness levels, keeping only Off and Light options for simpler configuration.

- Light mode now uses 75%/90% VRAM thresholds

- Simplified switch statements in texture/buffer cache

- Updated UI dropdowns for desktop and Android

- Light is now the default and recommended setting
This commit is contained in:
Zephyron
2026-01-30 17:55:43 +10:00
parent 4229eaa8fd
commit 1543418260
7 changed files with 12 additions and 88 deletions

View File

@@ -440,17 +440,11 @@
<string-array name="gcAggressivenessNames">
<item>@string/gc_aggressiveness_off</item>
<item>@string/gc_aggressiveness_light</item>
<item>@string/gc_aggressiveness_moderate</item>
<item>@string/gc_aggressiveness_heavy</item>
<item>@string/gc_aggressiveness_extreme</item>
</string-array>
<integer-array name="gcAggressivenessValues">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
</integer-array>
<!-- Applet Mode setting arrays -->

View File

@@ -153,6 +153,7 @@
<string name="dump_exefs_extracting">Extracting ExeFS…</string>
<string name="dump_success">Extraction completed successfully</string>
<string name="dump_failed">Extraction failed</string>
<string name="dump_failed_emulation_running">Cannot dump while a game is running. Please close the game first.</string>
<string name="select_dump_location_description">Choose where to save the extracted files. Select a location or use the default dump directory.</string>
<string name="select_location">Select Location</string>
<string name="use_default_location">Use Default</string>
@@ -1289,10 +1290,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<string name="log_vram_usage">Log VRAM Usage</string>
<string name="log_vram_usage_description">Enable logging of VRAM usage statistics for debugging purposes.</string>
<string name="gc_aggressiveness_off">Off (Not Recommended)</string>
<string name="gc_aggressiveness_light">Light</string>
<string name="gc_aggressiveness_moderate">Moderate (Recommended)</string>
<string name="gc_aggressiveness_heavy">Heavy (Low VRAM)</string>
<string name="gc_aggressiveness_extreme">Extreme (4GB VRAM)</string>
<string name="gc_aggressiveness_light">Light (Recommended)</string>
<string name="frame_skipping_header">Frame Skipping</string>
</resources>

View File

@@ -400,10 +400,7 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QWidget* parent) {
translations->insert({Settings::EnumMetadata<Settings::GCAggressiveness>::Index(),
{
PAIR(GCAggressiveness, Off, tr("Off (Not Recommended)")),
PAIR(GCAggressiveness, Light, tr("Light")),
PAIR(GCAggressiveness, Moderate, tr("Moderate (Recommended)")),
PAIR(GCAggressiveness, Heavy, tr("Heavy (Low VRAM)")),
PAIR(GCAggressiveness, Extreme, tr("Extreme (4GB VRAM)")),
PAIR(GCAggressiveness, Light, tr("Light (Recommended)")),
}});
translations->insert({Settings::EnumMetadata<Settings::RendererBackend>::Index(),

View File

@@ -520,9 +520,9 @@ struct Values {
// GC aggressiveness level for texture/buffer cache eviction
SwitchableSetting<GCAggressiveness, true> gc_aggressiveness{linkage,
GCAggressiveness::Moderate,
GCAggressiveness::Light,
GCAggressiveness::Off,
GCAggressiveness::Extreme,
GCAggressiveness::Light,
"gc_aggressiveness",
Category::RendererAdvanced,
Specialization::Default,

View File

@@ -878,11 +878,8 @@ inline u32 EnumMetadata<ExtendedDynamicState>::Index() {
// FIXED: VRAM leak prevention - GC aggressiveness levels
enum class GCAggressiveness : u32 {
Off = 0, // Disable automatic GC (not recommended)
Light = 1, // Light GC - only evict very old textures
Moderate = 2, // Moderate GC - balanced eviction (default)
Heavy = 3, // Heavy GC - aggressive eviction for low VRAM systems
Extreme = 4, // Extreme GC - maximum eviction for 4GB VRAM systems
Off = 0, // Disable automatic GC (not recommended)
Light = 1, // Light GC - gentle eviction of old textures/buffers
};
template <>
@@ -891,9 +888,6 @@ EnumMetadata<GCAggressiveness>::Canonicalizations() {
return {
{"Off", GCAggressiveness::Off},
{"Light", GCAggressiveness::Light},
{"Moderate", GCAggressiveness::Moderate},
{"Heavy", GCAggressiveness::Heavy},
{"Extreme", GCAggressiveness::Extreme},
};
}

View File

@@ -57,21 +57,10 @@ BufferCache<P>::BufferCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, R
critical_ratio = 0.95f;
break;
case Settings::GCAggressiveness::Light:
default:
expected_ratio = 0.70f;
critical_ratio = 0.85f;
break;
case Settings::GCAggressiveness::Moderate:
expected_ratio = 0.50f;
critical_ratio = 0.70f;
break;
case Settings::GCAggressiveness::Heavy:
expected_ratio = 0.40f;
critical_ratio = 0.60f;
break;
case Settings::GCAggressiveness::Extreme:
expected_ratio = 0.30f;
critical_ratio = 0.50f;
break;
}
minimum_memory = static_cast<u64>(static_cast<f32>(vram_limit_bytes) * expected_ratio);
@@ -106,23 +95,10 @@ void BufferCache<P>::RunGarbageCollector() {
switch (gc_level) {
case Settings::GCAggressiveness::Light:
default:
base_ticks = eviction_frames * 2;
base_iterations = 16;
break;
case Settings::GCAggressiveness::Moderate:
base_ticks = eviction_frames;
base_iterations = 32;
break;
case Settings::GCAggressiveness::Heavy:
base_ticks = std::max(1ULL, static_cast<unsigned long long>(eviction_frames / 2));
base_iterations = 64;
break;
case Settings::GCAggressiveness::Extreme:
base_ticks = 1;
base_iterations = 128;
break;
default:
break;
}
u64 ticks_to_destroy;

View File

@@ -75,21 +75,10 @@ TextureCache<P>::TextureCache(Runtime& runtime_, Tegra::MaxwellDeviceMemoryManag
critical_ratio = 0.99f;
break;
case Settings::GCAggressiveness::Light:
default:
expected_ratio = 0.75f;
critical_ratio = 0.90f;
break;
case Settings::GCAggressiveness::Moderate:
expected_ratio = 0.60f;
critical_ratio = 0.80f;
break;
case Settings::GCAggressiveness::Heavy:
expected_ratio = 0.50f;
critical_ratio = 0.70f;
break;
case Settings::GCAggressiveness::Extreme:
expected_ratio = 0.40f;
critical_ratio = 0.60f;
break;
}
expected_memory = static_cast<u64>(static_cast<f32>(vram_limit_bytes) * expected_ratio);
@@ -148,23 +137,10 @@ void TextureCache<P>::RunGarbageCollector() {
switch (gc_level) {
case Settings::GCAggressiveness::Light:
default:
base_ticks = eviction_frames * 2;
base_iterations = 5;
break;
case Settings::GCAggressiveness::Moderate:
base_ticks = eviction_frames;
base_iterations = 10;
break;
case Settings::GCAggressiveness::Heavy:
base_ticks = std::max(1ULL, static_cast<unsigned long long>(eviction_frames / 2));
base_iterations = 20;
break;
case Settings::GCAggressiveness::Extreme:
base_ticks = 1;
base_iterations = 40;
break;
default:
break;
}
if (emergency_mode) {
@@ -411,21 +387,10 @@ void TextureCache<P>::SetVRAMLimit(u64 limit_bytes) {
critical_ratio = 0.99f;
break;
case Settings::GCAggressiveness::Light:
default:
expected_ratio = 0.75f;
critical_ratio = 0.90f;
break;
case Settings::GCAggressiveness::Moderate:
expected_ratio = 0.60f;
critical_ratio = 0.80f;
break;
case Settings::GCAggressiveness::Heavy:
expected_ratio = 0.50f;
critical_ratio = 0.70f;
break;
case Settings::GCAggressiveness::Extreme:
expected_ratio = 0.40f;
critical_ratio = 0.60f;
break;
}
expected_memory = static_cast<u64>(static_cast<f32>(vram_limit_bytes) * expected_ratio);