Przeglądaj źródła

Merge pull request #4337 from lat9nq/fix-per-game-async

main: Set async gpu properly after loading per-game setting
bunnei 6 lat temu
rodzic
commit
2781201bfb
3 zmienionych plików z 10 dodań i 0 usunięć
  1. 5 0
      src/core/settings.cpp
  2. 3 0
      src/core/settings.h
  3. 2 0
      src/yuzu/configuration/config.cpp

+ 5 - 0
src/core/settings.cpp

@@ -184,4 +184,9 @@ void RestoreGlobalState() {
     values.sound_index.SetGlobal(true);
 }
 
+void Sanitize() {
+    values.use_asynchronous_gpu_emulation.SetValue(
+        values.use_asynchronous_gpu_emulation.GetValue() || values.use_multi_core.GetValue());
+}
+
 } // namespace Settings

+ 3 - 0
src/core/settings.h

@@ -526,4 +526,7 @@ void LogSettings();
 // Restore the global state of all applicable settings in the Values struct
 void RestoreGlobalState();
 
+// Fixes settings that are known to cause issues with the emulator
+void Sanitize();
+
 } // namespace Settings

+ 2 - 0
src/yuzu/configuration/config.cpp

@@ -1368,11 +1368,13 @@ void Config::WriteSettingGlobal(const QString& name, const QVariant& value, bool
 
 void Config::Reload() {
     ReadValues();
+    Settings::Sanitize();
     // To apply default value changes
     SaveValues();
     Settings::Apply();
 }
 
 void Config::Save() {
+    Settings::Sanitize();
     SaveValues();
 }