android: config: Expose VSync as a configurable setting.
This commit is contained in:
parent
f0ed20c8a2
commit
b4725332a2
5 changed files with 44 additions and 9 deletions
|
@ -73,6 +73,11 @@ enum class IntSetting(
|
||||||
Settings.SECTION_RENDERER,
|
Settings.SECTION_RENDERER,
|
||||||
2
|
2
|
||||||
),
|
),
|
||||||
|
RENDERER_VSYNC(
|
||||||
|
"use_vsync",
|
||||||
|
Settings.SECTION_RENDERER,
|
||||||
|
0
|
||||||
|
),
|
||||||
RENDERER_SCALING_FILTER(
|
RENDERER_SCALING_FILTER(
|
||||||
"scaling_filter",
|
"scaling_filter",
|
||||||
Settings.SECTION_RENDERER,
|
Settings.SECTION_RENDERER,
|
||||||
|
@ -115,7 +120,8 @@ enum class IntSetting(
|
||||||
RENDERER_ASYNCHRONOUS_SHADERS,
|
RENDERER_ASYNCHRONOUS_SHADERS,
|
||||||
RENDERER_DEBUG,
|
RENDERER_DEBUG,
|
||||||
RENDERER_BACKEND,
|
RENDERER_BACKEND,
|
||||||
RENDERER_RESOLUTION
|
RENDERER_RESOLUTION,
|
||||||
|
RENDERER_VSYNC
|
||||||
)
|
)
|
||||||
|
|
||||||
fun from(key: String): IntSetting? = IntSetting.values().firstOrNull { it.key == key }
|
fun from(key: String): IntSetting? = IntSetting.values().firstOrNull { it.key == key }
|
||||||
|
|
|
@ -249,6 +249,17 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
|
||||||
IntSetting.RENDERER_RESOLUTION.defaultValue
|
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(
|
add(
|
||||||
SingleChoiceSetting(
|
SingleChoiceSetting(
|
||||||
IntSetting.RENDERER_SCALING_FILTER,
|
IntSetting.RENDERER_SCALING_FILTER,
|
||||||
|
|
|
@ -210,27 +210,24 @@ void Config::ReadValues() {
|
||||||
ReadSetting("Renderer", Settings::values.speed_limit);
|
ReadSetting("Renderer", Settings::values.speed_limit);
|
||||||
ReadSetting("Renderer", Settings::values.use_disk_shader_cache);
|
ReadSetting("Renderer", Settings::values.use_disk_shader_cache);
|
||||||
ReadSetting("Renderer", Settings::values.use_asynchronous_gpu_emulation);
|
ReadSetting("Renderer", Settings::values.use_asynchronous_gpu_emulation);
|
||||||
|
ReadSetting("Renderer", Settings::values.vsync_mode);
|
||||||
ReadSetting("Renderer", Settings::values.shader_backend);
|
ReadSetting("Renderer", Settings::values.shader_backend);
|
||||||
ReadSetting("Renderer", Settings::values.use_asynchronous_shaders);
|
ReadSetting("Renderer", Settings::values.use_asynchronous_shaders);
|
||||||
ReadSetting("Renderer", Settings::values.nvdec_emulation);
|
ReadSetting("Renderer", Settings::values.nvdec_emulation);
|
||||||
ReadSetting("Renderer", Settings::values.use_fast_gpu_time);
|
ReadSetting("Renderer", Settings::values.use_fast_gpu_time);
|
||||||
ReadSetting("Renderer", Settings::values.use_vulkan_driver_pipeline_cache);
|
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
|
// Use GPU accuracy normal by default on Android
|
||||||
Settings::values.gpu_accuracy = static_cast<Settings::GPUAccuracy>(config->GetInteger(
|
Settings::values.gpu_accuracy = static_cast<Settings::GPUAccuracy>(config->GetInteger(
|
||||||
"Renderer", "gpu_accuracy", static_cast<u32>(Settings::GPUAccuracy::Normal)));
|
"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
|
// Use GPU default anisotropic filtering on Android
|
||||||
Settings::values.max_anisotropy = config->GetInteger("Renderer", "max_anisotropy", 1);
|
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
|
// Disable ASTC compute by default on Android
|
||||||
Settings::values.accelerate_astc = config->GetBoolean("Renderer", "accelerate_astc", false);
|
Settings::values.accelerate_astc = config->GetBoolean("Renderer", "accelerate_astc", false);
|
||||||
|
|
||||||
|
|
|
@ -96,6 +96,13 @@
|
||||||
<item>@string/resolution_four</item>
|
<item>@string/resolution_four</item>
|
||||||
</string-array>
|
</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">
|
<integer-array name="rendererResolutionValues">
|
||||||
<item>0</item>
|
<item>0</item>
|
||||||
<item>1</item>
|
<item>1</item>
|
||||||
|
@ -105,6 +112,13 @@
|
||||||
<item>5</item>
|
<item>5</item>
|
||||||
</integer-array>
|
</integer-array>
|
||||||
|
|
||||||
|
<integer-array name="rendererVSyncValues">
|
||||||
|
<item>0</item>
|
||||||
|
<item>1</item>
|
||||||
|
<item>2</item>
|
||||||
|
<item>3</item>
|
||||||
|
</integer-array>
|
||||||
|
|
||||||
<string-array name="rendererAspectRatioNames">
|
<string-array name="rendererAspectRatioNames">
|
||||||
<item>@string/ratio_default</item>
|
<item>@string/ratio_default</item>
|
||||||
<item>@string/ratio_force_four_three</item>
|
<item>@string/ratio_force_four_three</item>
|
||||||
|
|
|
@ -122,6 +122,7 @@
|
||||||
<string name="renderer_api">API</string>
|
<string name="renderer_api">API</string>
|
||||||
<string name="renderer_accuracy">Accuracy level</string>
|
<string name="renderer_accuracy">Accuracy level</string>
|
||||||
<string name="renderer_resolution">Resolution</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_aspect_ratio">Aspect Ratio</string>
|
||||||
<string name="renderer_scaling_filter">Window Adapting Filter</string>
|
<string name="renderer_scaling_filter">Window Adapting Filter</string>
|
||||||
<string name="renderer_anti_aliasing">Anti-Aliasing Method</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_three">3X (2160p/3240p) (Slow)</string>
|
||||||
<string name="resolution_four">4X (2880p/4320p) (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 -->
|
<!-- Scaling Filters -->
|
||||||
<string name="scaling_filter_nearest_neighbor">Nearest Neighbor</string>
|
<string name="scaling_filter_nearest_neighbor">Nearest Neighbor</string>
|
||||||
<string name="scaling_filter_bilinear">Bilinear</string>
|
<string name="scaling_filter_bilinear">Bilinear</string>
|
||||||
|
|
Loading…
Reference in a new issue