fix format_reinterpretation on pc and add it to android (#3049)

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3049
Co-authored-by: Kleidis <kleidis1@protonmail.com>
Co-committed-by: Kleidis <kleidis1@protonmail.com>
This commit is contained in:
Kleidis
2025-11-19 19:34:39 +01:00
committed by lizzie
parent 05e8f2fd83
commit fa94828ea7
8 changed files with 58 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ enum class IntSetting(override val key: String) : AbstractIntSetting {
RENDERER_NVDEC_EMULATION("nvdec_emulation"),
RENDERER_ASTC_DECODE_METHOD("accelerate_astc"),
RENDERER_ASTC_RECOMPRESSION("astc_recompression"),
RENDERER_FORMAT_REINTERPRETATION("format_reinterpretation"),
RENDERER_ACCURACY("gpu_accuracy"),
RENDERER_RESOLUTION("resolution_setup"),
RENDERER_VSYNC("use_vsync"),

View File

@@ -359,6 +359,14 @@ abstract class SettingsItem(
valuesId = R.array.astcRecompressionMethodValues
)
)
put(
SingleChoiceSetting(
IntSetting.RENDERER_FORMAT_REINTERPRETATION,
titleId = R.string.format_reinterpretation,
choicesId = R.array.formatReinterpretationNames,
valuesId = R.array.formatReinterpretationValues
)
)
put(
SingleChoiceSetting(
IntSetting.RENDERER_VRAM_USAGE_MODE,

View File

@@ -469,6 +469,7 @@ class SettingsFragmentPresenter(
add(IntSetting.RENDERER_NVDEC_EMULATION.key)
add(IntSetting.RENDERER_ASTC_DECODE_METHOD.key)
add(IntSetting.RENDERER_ASTC_RECOMPRESSION.key)
add(IntSetting.RENDERER_FORMAT_REINTERPRETATION.key)
add(IntSetting.RENDERER_VRAM_USAGE_MODE.key)
add(IntSetting.RENDERER_OPTIMIZE_SPIRV_OUTPUT.key)

View File

@@ -161,6 +161,22 @@
<item>2</item> <!-- BC3 -->
</integer-array>
<!-- Format Reinterpretation Choices -->
<string-array name="formatReinterpretationNames">
<item>@string/format_reinterpretation_disabled</item>
<item>@string/format_reinterpretation_r32uint_to_r32sfloat</item>
<item>@string/format_reinterpretation_r32sint_to_r32uint</item>
<item>@string/format_reinterpretation_r32sfloat_to_r32sint</item>
</string-array>
<!-- Format Reinterpretation Values -->
<integer-array name="formatReinterpretationValues">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</integer-array>
<!-- NVDEC Emulation Choices -->
<string-array name="rendererNvdecNames">
<item>@string/nvdec_emulation_none</item> <!-- Off -->

View File

@@ -943,7 +943,14 @@
<string name="astc_recompression_bc1">BC1 (Low Quality)</string>
<string name="astc_recompression_bc3">BC3 (Medium Quality)</string>
<!-- ASTC Recompression Method Choices -->
<!-- Format Reinterpretation -->
<string name="format_reinterpretation">Format Reinterpretation</string>
<string name="format_reinterpretation_disabled">Disabled</string>
<string name="format_reinterpretation_r32uint_to_r32sfloat">R32 UInt to R32 SFloat</string>
<string name="format_reinterpretation_r32sint_to_r32uint">R32 SInt to R32 UInt</string>
<string name="format_reinterpretation_r32sfloat_to_r32sint">R32 SFloat to R32 SInt</string>
<!-- VRAM Usage Mode -->
<string name="vram_usage_mode">VRAM Usage Mode</string>
<string name="vram_usage_mode_description">Control how aggressively the emulator allocates and frees GPU memory.</string>
<string name="vram_usage_conservative">Conservative</string>

View File

@@ -47,6 +47,7 @@ SWITCHABLE(AstcRecompression, true);
SWITCHABLE(AudioMode, true);
SWITCHABLE(CpuBackend, true);
SWITCHABLE(CpuAccuracy, true);
SWITCHABLE(FormatReinterpretation, true);
SWITCHABLE(FullscreenMode, true);
SWITCHABLE(GpuAccuracy, true);
SWITCHABLE(Language, true);

View File

@@ -196,6 +196,11 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QObject* parent)
tr("Stretches the renderer to fit the specified aspect ratio.\nMost games only support "
"16:9, so modifications are required to get other ratios.\nAlso controls the "
"aspect ratio of captured screenshots."));
INSERT(Settings,
format_reinterpretation,
tr("Format Reinterpretation:"),
tr("Reinterprets certain texture formats to improve performance.\nMay cause "
"graphical issues in some games."));
INSERT(Settings,
use_disk_shader_cache,
tr("Use persistent pipeline cache"),
@@ -717,6 +722,13 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QObject* parent)
PAIR(GpuOverclock, Medium, tr("Medium (256)")),
PAIR(GpuOverclock, High, tr("High (512)")),
}});
translations->insert({Settings::EnumMetadata<Settings::FormatReinterpretation>::Index(),
{
PAIR(FormatReinterpretation, Disabled, tr("Disabled")),
PAIR(FormatReinterpretation, R32UintToR32Sfloat, tr("R32 Uint to R32 Float")),
PAIR(FormatReinterpretation, R32SintToR32Uint, tr("R32 Sint to R32 Uint")),
PAIR(FormatReinterpretation, R32SfloatToR32Sint, tr("R32 Float to R32 Sint")),
}});
#undef PAIR
#undef CTX_PAIR

View File

@@ -55,6 +55,17 @@ static const std::map<Settings::ScalingFilter, QString> scaling_filter_texts_map
{Settings::ScalingFilter::Mmpx, QStringLiteral(QT_TRANSLATE_NOOP("MainWindow", "MMPX"))},
};
static const std::map<Settings::FormatReinterpretation, QString> format_reinterpretation_texts_map = {
{Settings::FormatReinterpretation::Disabled,
QStringLiteral(QT_TRANSLATE_NOOP("MainWindow", "Disabled"))},
{Settings::FormatReinterpretation::R32UintToR32Sfloat,
QStringLiteral(QT_TRANSLATE_NOOP("MainWindow", "R32 Uint to R32 Float"))},
{Settings::FormatReinterpretation::R32SintToR32Uint,
QStringLiteral(QT_TRANSLATE_NOOP("MainWindow", "R32 Sint to R32 Uint"))},
{Settings::FormatReinterpretation::R32SfloatToR32Sint,
QStringLiteral(QT_TRANSLATE_NOOP("MainWindow", "R32 Float to R32 Sint"))},
};
static const std::map<Settings::ConsoleMode, QString> use_docked_mode_texts_map = {
{Settings::ConsoleMode::Docked, QStringLiteral(QT_TRANSLATE_NOOP("MainWindow", "Docked"))},
{Settings::ConsoleMode::Handheld, QStringLiteral(QT_TRANSLATE_NOOP("MainWindow", "Handheld"))},