diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/IntSetting.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/IntSetting.kt index c07e566fe..c5722a5a1 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/IntSetting.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/model/IntSetting.kt @@ -73,6 +73,11 @@ enum class IntSetting( Settings.SECTION_RENDERER, 2 ), + RENDERER_VSYNC( + "use_vsync", + Settings.SECTION_RENDERER, + 0 + ), RENDERER_SCALING_FILTER( "scaling_filter", Settings.SECTION_RENDERER, @@ -115,7 +120,8 @@ enum class IntSetting( RENDERER_ASYNCHRONOUS_SHADERS, RENDERER_DEBUG, RENDERER_BACKEND, - RENDERER_RESOLUTION + RENDERER_RESOLUTION, + RENDERER_VSYNC ) fun from(key: String): IntSetting? = IntSetting.values().firstOrNull { it.key == key } diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt index 5b4272a74..14ae513e2 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsFragmentPresenter.kt @@ -249,6 +249,17 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView) IntSetting.RENDERER_RESOLUTION.defaultValue ) ) + add( + SingleChoiceSetting( + IntSetting.RENDERER_VSYNC, + R.string.renderer_vsync, + 0, + R.array.rendererVSyncNames, + R.array.rendererVSyncValues, + IntSetting.RENDERER_VSYNC.key, + IntSetting.RENDERER_VSYNC.defaultValue + ) + ) add( SingleChoiceSetting( IntSetting.RENDERER_SCALING_FILTER, diff --git a/src/android/app/src/main/jni/config.cpp b/src/android/app/src/main/jni/config.cpp index b3aa9071b..6b4c08145 100644 --- a/src/android/app/src/main/jni/config.cpp +++ b/src/android/app/src/main/jni/config.cpp @@ -210,27 +210,24 @@ void Config::ReadValues() { ReadSetting("Renderer", Settings::values.speed_limit); ReadSetting("Renderer", Settings::values.use_disk_shader_cache); ReadSetting("Renderer", Settings::values.use_asynchronous_gpu_emulation); + ReadSetting("Renderer", Settings::values.vsync_mode); ReadSetting("Renderer", Settings::values.shader_backend); ReadSetting("Renderer", Settings::values.use_asynchronous_shaders); ReadSetting("Renderer", Settings::values.nvdec_emulation); ReadSetting("Renderer", Settings::values.use_fast_gpu_time); ReadSetting("Renderer", Settings::values.use_vulkan_driver_pipeline_cache); + ReadSetting("Renderer", Settings::values.bg_red); + ReadSetting("Renderer", Settings::values.bg_green); + ReadSetting("Renderer", Settings::values.bg_blue); + // Use GPU accuracy normal by default on Android Settings::values.gpu_accuracy = static_cast(config->GetInteger( "Renderer", "gpu_accuracy", static_cast(Settings::GPUAccuracy::Normal))); - // Use Mailbox VSync by default on Android - Settings::values.vsync_mode = static_cast(config->GetInteger( - "Renderer", "use_vsync", static_cast(Settings::VSyncMode::Mailbox))); - // Use GPU default anisotropic filtering on Android Settings::values.max_anisotropy = config->GetInteger("Renderer", "max_anisotropy", 1); - ReadSetting("Renderer", Settings::values.bg_red); - ReadSetting("Renderer", Settings::values.bg_green); - ReadSetting("Renderer", Settings::values.bg_blue); - // Disable ASTC compute by default on Android Settings::values.accelerate_astc = config->GetBoolean("Renderer", "accelerate_astc", false); diff --git a/src/android/app/src/main/res/values/arrays.xml b/src/android/app/src/main/res/values/arrays.xml index ce9a576c2..fa88770c8 100644 --- a/src/android/app/src/main/res/values/arrays.xml +++ b/src/android/app/src/main/res/values/arrays.xml @@ -96,6 +96,13 @@ @string/resolution_four + + @string/renderer_vsync_immediate + @string/renderer_vsync_mailbox + @string/renderer_vsync_fifo + @string/renderer_vsync_fifo_relaxed + + 0 1 @@ -105,6 +112,13 @@ 5 + + 0 + 1 + 2 + 3 + + @string/ratio_default @string/ratio_force_four_three diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml index 6e4b1e630..87e07b581 100644 --- a/src/android/app/src/main/res/values/strings.xml +++ b/src/android/app/src/main/res/values/strings.xml @@ -122,6 +122,7 @@ API Accuracy level Resolution + VSync mode Aspect Ratio Window Adapting Filter Anti-Aliasing Method @@ -259,6 +260,12 @@ 3X (2160p/3240p) (Slow) 4X (2880p/4320p) (Slow) + + Immediate (Off) + Mailbox + FIFO (On) + FIFO Relaxed + Nearest Neighbor Bilinear