android: Add dyna_state setting to UI

This commit is contained in:
Briar 2025-04-24 21:20:49 +02:00
parent 01065a89a5
commit 13eb5e1be4
5 changed files with 23 additions and 2 deletions

View file

@ -6,7 +6,8 @@ package org.yuzu.yuzu_emu.features.settings.model
import org.yuzu.yuzu_emu.utils.NativeConfig import org.yuzu.yuzu_emu.utils.NativeConfig
enum class ByteSetting(override val key: String) : AbstractByteSetting { enum class ByteSetting(override val key: String) : AbstractByteSetting {
AUDIO_VOLUME("volume"); AUDIO_VOLUME("volume"),
RENDERER_DYNA_STATE("dyna_state");
override fun getByte(needsGlobal: Boolean): Byte = NativeConfig.getByte(key, needsGlobal) override fun getByte(needsGlobal: Boolean): Byte = NativeConfig.getByte(key, needsGlobal)

View file

@ -24,7 +24,6 @@ enum class IntSetting(override val key: String) : AbstractIntSetting {
RENDERER_SCREEN_LAYOUT("screen_layout"), RENDERER_SCREEN_LAYOUT("screen_layout"),
RENDERER_ASPECT_RATIO("aspect_ratio"), RENDERER_ASPECT_RATIO("aspect_ratio"),
RENDERER_OPTIMIZE_SPIRV_OUTPUT("optimize_spirv_output"), RENDERER_OPTIMIZE_SPIRV_OUTPUT("optimize_spirv_output"),
RENDERER_DYNA_STATE("dyna_state"),
AUDIO_OUTPUT_ENGINE("output_engine"), AUDIO_OUTPUT_ENGINE("output_engine"),
MAX_ANISOTROPY("max_anisotropy"), MAX_ANISOTROPY("max_anisotropy"),
THEME("theme"), THEME("theme"),

View file

@ -17,6 +17,7 @@ import org.yuzu.yuzu_emu.features.settings.model.IntSetting
import org.yuzu.yuzu_emu.features.settings.model.LongSetting import org.yuzu.yuzu_emu.features.settings.model.LongSetting
import org.yuzu.yuzu_emu.features.settings.model.ShortSetting import org.yuzu.yuzu_emu.features.settings.model.ShortSetting
import org.yuzu.yuzu_emu.features.settings.model.StringSetting import org.yuzu.yuzu_emu.features.settings.model.StringSetting
import org.yuzu.yuzu_emu.utils.GpuDriverHelper
import org.yuzu.yuzu_emu.utils.NativeConfig import org.yuzu.yuzu_emu.utils.NativeConfig
/** /**
@ -56,6 +57,13 @@ abstract class SettingsItem(
return NativeInput.getStyleIndex(0) != NpadStyleIndex.Handheld return NativeInput.getStyleIndex(0) != NpadStyleIndex.Handheld
} }
if (setting.key == ByteSetting.RENDERER_DYNA_STATE.key) {
// Can't change on Mali GPU's otherwise no game loading for you
if (!GpuDriverHelper.supportsCustomDriverLoading()) {
return false
}
}
// Can't edit settings that aren't saveable in per-game config even if they are switchable // Can't edit settings that aren't saveable in per-game config even if they are switchable
if (NativeConfig.isPerGameConfigLoaded() && !setting.isSaveable) { if (NativeConfig.isPerGameConfigLoaded() && !setting.isSaveable) {
return false return false
@ -118,6 +126,16 @@ abstract class SettingsItem(
descriptionId = R.string.frame_limit_enable_description descriptionId = R.string.frame_limit_enable_description
) )
) )
put(
SliderSetting(
ByteSetting.RENDERER_DYNA_STATE,
titleId = R.string.dyna_state,
descriptionId = R.string.dyna_state_description,
min = 0,
max = 3,
)
)
put( put(
SliderSetting( SliderSetting(
ShortSetting.RENDERER_SPEED_LIMIT, ShortSetting.RENDERER_SPEED_LIMIT,

View file

@ -471,6 +471,7 @@ class SettingsFragmentPresenter(
descriptionId = R.string.frame_skipping_description descriptionId = R.string.frame_skipping_description
) )
) )
add(ByteSetting.RENDERER_DYNA_STATE.key)
add( add(
SwitchSetting( SwitchSetting(
syncCoreSpeedSetting, syncCoreSpeedSetting,

View file

@ -292,6 +292,8 @@
<string name="nvdec_emulation">NVDEC Emulation</string> <string name="nvdec_emulation">NVDEC Emulation</string>
<string name="nvdec_emulation_description">Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance.</string> <string name="nvdec_emulation_description">Specifies how videos should be decoded. It can either use the CPU or the GPU for decoding, or perform no decoding at all (black screen on videos). In most cases, GPU decoding provides the best performance.</string>
<string name="shader_backend">Shader Backend</string> <string name="shader_backend">Shader Backend</string>
<string name="dyna_state">Extended Dynamic State</string>
<string name="dyna_state_description">Enables the VkExtendedDynamicState* extensions.\nHigher dynamic states will generally improve performance, but may cause issues on certain games or devices\nDefault value is 0 for Disabled, The third value might not work properly on some devices</string>
<!-- Debug settings strings --> <!-- Debug settings strings -->
<string name="cpu">CPU</string> <string name="cpu">CPU</string>