diff options
Diffstat (limited to 'src/android/app')
5 files changed, 44 insertions, 9 deletions
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 @@ -251,6 +251,17 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView) ) 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, R.string.renderer_scaling_filter, 0, 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<Settings::GPUAccuracy>(config->GetInteger( "Renderer", "gpu_accuracy", static_cast<u32>(Settings::GPUAccuracy::Normal))); - // Use Mailbox VSync by default on Android - Settings::values.vsync_mode = static_cast<Settings::VSyncMode>(config->GetInteger( - "Renderer", "use_vsync", static_cast<u32>(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 @@ <item>@string/resolution_four</item> </string-array> + <string-array name="rendererVSyncNames"> + <item>@string/renderer_vsync_immediate</item> + <item>@string/renderer_vsync_mailbox</item> + <item>@string/renderer_vsync_fifo</item> + <item>@string/renderer_vsync_fifo_relaxed</item> + </string-array> + <integer-array name="rendererResolutionValues"> <item>0</item> <item>1</item> @@ -105,6 +112,13 @@ <item>5</item> </integer-array> + <integer-array name="rendererVSyncValues"> + <item>0</item> + <item>1</item> + <item>2</item> + <item>3</item> + </integer-array> + <string-array name="rendererAspectRatioNames"> <item>@string/ratio_default</item> <item>@string/ratio_force_four_three</item> 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 @@ <string name="renderer_api">API</string> <string name="renderer_accuracy">Accuracy level</string> <string name="renderer_resolution">Resolution</string> + <string name="renderer_vsync">VSync mode</string> <string name="renderer_aspect_ratio">Aspect Ratio</string> <string name="renderer_scaling_filter">Window Adapting Filter</string> <string name="renderer_anti_aliasing">Anti-Aliasing Method</string> @@ -259,6 +260,12 @@ <string name="resolution_three">3X (2160p/3240p) (Slow)</string> <string name="resolution_four">4X (2880p/4320p) (Slow)</string> + <!-- Renderer VSync --> + <string name="renderer_vsync_immediate">Immediate (Off)</string> + <string name="renderer_vsync_mailbox">Mailbox</string> + <string name="renderer_vsync_fifo">FIFO (On)</string> + <string name="renderer_vsync_fifo_relaxed">FIFO Relaxed</string> + <!-- Scaling Filters --> <string name="scaling_filter_nearest_neighbor">Nearest Neighbor</string> <string name="scaling_filter_bilinear">Bilinear</string> |