android: Add Texture Sampling settings UI

This commit is contained in:
Reg Tiangha 2024-10-07 06:27:19 -06:00 committed by OpenSauce
parent 43dbe42b29
commit ba7b061724
6 changed files with 38 additions and 3 deletions

View File

@ -60,6 +60,7 @@ enum class IntSetting(
VSYNC("use_vsync_new", Settings.SECTION_RENDERER, 1),
DEBUG_RENDERER("renderer_debug", Settings.SECTION_DEBUG, 0),
TEXTURE_FILTER("texture_filter", Settings.SECTION_RENDERER, 0),
TEXTURE_SAMPLING("texture_sampling", Settings.SECTION_RENDERER, 0),
USE_FRAME_LIMIT("use_frame_limit", Settings.SECTION_RENDERER, 1),
DELAY_RENDER_THREAD_US("delay_game_render_thread_us", Settings.SECTION_RENDERER, 0),
USE_ARTIC_BASE_CONTROLLER("use_artic_base_controller", Settings.SECTION_CONTROLS, 0),

View File

@ -911,7 +911,18 @@ class SettingsFragmentPresenter(private val fragmentView: SettingsFragmentView)
IntSetting.ASYNC_CUSTOM_LOADING.defaultValue
)
)
add(HeaderSetting(R.string.advanced))
add(
SingleChoiceSetting(
IntSetting.TEXTURE_SAMPLING,
R.string.texture_sampling_name,
R.string.texture_sampling_description,
R.array.textureSamplingNames,
R.array.textureSamplingValues,
IntSetting.TEXTURE_SAMPLING.key,
IntSetting.TEXTURE_SAMPLING.defaultValue
)
)
// Disabled until custom texture implementation gets rewrite, current one overloads RAM
// and crashes Citra.
// add(

View File

@ -125,6 +125,11 @@ shaders_accurate_mul =
# 0: Interpreter (slow), 1 (default): JIT (fast)
use_shader_jit =
# Overrides the sampling filter used by games. This can be useful in certain
# cases with poorly behaved games when upscaling.
# 0 (default): Game Controlled, 2: Nearest Neighbor, 3: Linear
texture_sampling =
# Forces VSync on the display thread. Usually doesn't impact performance, but on some drivers it can
# so only turn this off if you notice a speed difference.
# 0: Off, 1 (default): On

View File

@ -233,6 +233,17 @@
<item>5</item>
</integer-array>
<string-array name="textureSamplingNames">
<item>@string/game_controlled</item>
<item>@string/nearest_neighbor</item>
<item>@string/linear</item>
</string-array>
<integer-array name="textureSamplingValues">
<item>0</item>
<item>1</item>
<item>2</item>
</integer-array>
<string-array name="staticThemeNames">
<item>Blue (Default)</item>
<item>Cyan</item>

View File

@ -231,6 +231,9 @@
<string name="linear_filtering_description">Enables linear filtering, which causes game visuals to appear smoother.</string>
<string name="texture_filter_name">Texture Filter</string>
<string name="texture_filter_description">Enhances the visuals of applications by applying a filter to textures. The supported filters are Anime4K Ultrafast, Bicubic, ScaleForce, xBRZ freescale, and MMPX.</string>
<string name="advanced">Advanced"</string>
<string name="texture_sampling_name">Texture Sampling</string>
<string name="texture_sampling_description">Overrides the sampling filter used by games. This can be useful in certain cases with poorly behaved games when upscaling. If unsure, set this to Game Controlled.</string>
<string name="hw_shaders">Enable Hardware Shader</string>
<string name="hw_shaders_description">Uses hardware to emulate 3DS shaders. When enabled, game performance will be significantly improved.</string>
<string name="shaders_accurate_mul">Accurate Multiplication</string>
@ -598,11 +601,15 @@
<!-- Texture filter names -->
<string name="anime4k">Anime4K</string>
<string name="bicubic">Bicubic</string>
<string name="nearest_neighbor">Nearest Neighbor</string>
<string name="scaleforce">ScaleForce</string>
<string name="xbrz">xBRZ</string>
<string name="mmpx">MMPX</string>
<!-- Texture Sampling names -->
<string name="game_controlled">Game Controlled</string>
<string name="nearest_neighbor">Nearest Neighbor</string>
<string name="linear">Linear</string>
<!-- Sound output modes -->
<string name="mono">Mono</string>
<string name="stereo">Stereo</string>

View File

@ -258,7 +258,7 @@
<item>
<widget class="QLabel" name="texture_sampling_label">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Overrides the sampling filter used by applications. This can be useful in certain cases with poorly behaved applications when upscaling. If unsure set this to Application Controlled&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Overrides the sampling filter used by applications. This can be useful in certain cases with poorly behaved applications when upscaling. If unsure, set this to Application Controlled&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Texture Sampling</string>