Compare commits

...

3 Commits

Author SHA1 Message Date
72374
e8a04f4632
Merge 7a45533d80 into c650473fdc 2026-04-07 10:44:57 +03:00
OpenSauce04
c650473fdc Default to Vulkan renderer on Android 2026-04-06 18:58:52 +01:00
72374
7a45533d80 feat: Offer settings for up to 256 times the original resolution ("16x") 2026-04-02 14:51:25 +02:00
8 changed files with 71 additions and 6 deletions

View File

@ -17,7 +17,7 @@ enum class IntSetting(
CAMERA_INNER_FLIP(SettingKeys.camera_inner_flip(), Settings.SECTION_CAMERA, 0),
CAMERA_OUTER_LEFT_FLIP(SettingKeys.camera_outer_left_flip(), Settings.SECTION_CAMERA, 0),
CAMERA_OUTER_RIGHT_FLIP(SettingKeys.camera_outer_right_flip(), Settings.SECTION_CAMERA, 0),
GRAPHICS_API(SettingKeys.graphics_api(), Settings.SECTION_RENDERER, 1),
GRAPHICS_API(SettingKeys.graphics_api(), Settings.SECTION_RENDERER, 2),
RESOLUTION_FACTOR(SettingKeys.resolution_factor(), Settings.SECTION_RENDERER, 1),
STEREOSCOPIC_3D_MODE(SettingKeys.render_3d(), Settings.SECTION_RENDERER, 2),
STEREOSCOPIC_3D_DEPTH(SettingKeys.factor_3d(), Settings.SECTION_RENDERER, 0),

View File

@ -90,7 +90,7 @@ static const char* android_config_default_file_content = (BOOST_HANA_STRING(R"(
[Renderer]
# Whether to render using OpenGL
# 1: OpenGL ES (default), 2: Vulkan
# 1: OpenGL ES, 2: Vulkan (default)
)") DECLARE_KEY(graphics_api) BOOST_HANA_STRING(R"(
# Whether to compile shaders on multiple worker threads (Vulkan only)

View File

@ -384,6 +384,12 @@
<item>@string/internal_resolution_setting_8x</item>
<item>@string/internal_resolution_setting_9x</item>
<item>@string/internal_resolution_setting_10x</item>
<item>@string/internal_resolution_setting_11x</item>
<item>@string/internal_resolution_setting_12x</item>
<item>@string/internal_resolution_setting_13x</item>
<item>@string/internal_resolution_setting_14x</item>
<item>@string/internal_resolution_setting_15x</item>
<item>@string/internal_resolution_setting_16x</item>
</string-array>
<integer-array name="resolutionFactorValues">
<item>0</item>
@ -397,6 +403,12 @@
<item>8</item>
<item>9</item>
<item>10</item>
<item>11</item>
<item>12</item>
<item>13</item>
<item>14</item>
<item>15</item>
<item>16</item>
</integer-array>
<string-array name="countries">

View File

@ -294,6 +294,12 @@
<string name="internal_resolution_setting_8x">8x Native (3200x1920)</string>
<string name="internal_resolution_setting_9x">9x Native (3600x2160)</string>
<string name="internal_resolution_setting_10x">10x Native (4000x2400)</string>
<string name="internal_resolution_setting_11x">11x Native (4400x2640)</string>
<string name="internal_resolution_setting_12x">12x Native (4800x2880)</string>
<string name="internal_resolution_setting_13x">13x Native (5200x3120)</string>
<string name="internal_resolution_setting_14x">14x Native (5600x3360)</string>
<string name="internal_resolution_setting_15x">15x Native (6000x3600)</string>
<string name="internal_resolution_setting_16x">16x Native (6400x3840)</string>
<string name="performance_warning">Turning off this setting will significantly reduce emulation performance! For the best experience, it is recommended that you leave this setting enabled.</string>
<string name="debug_warning">Warning: Modifying these settings will slow emulation</string>
<string name="stereoscopy">Stereoscopy</string>

View File

@ -373,6 +373,12 @@ static constexpr retro_core_option_v2_definition option_definitions[] = {
{ "8", "8x (3200x1920)" },
{ "9", "9x (3600x2160)" },
{ "10", "10x (4000x2400)" },
{ "11", "11x (4400x2640)" },
{ "12", "12x (4800x2880)" },
{ "13", "13x (5200x3120)" },
{ "14", "14x (5600x3360)" },
{ "15", "15x (6000x3600)" },
{ "16", "16x (6400x3840)" },
{ nullptr, nullptr }
},
"1"

View File

@ -61,7 +61,14 @@ bool GetMicrophoneInterface(struct retro_microphone_interface* mic_interface) {
}
Settings::GraphicsAPI GetPreferredRenderer() {
// try and maintain the current driver
// On Android, we really want to default to Vulkan if we can, so we'll ignore the frontend's
// recommendation if possible...
#if defined(ANDROID) && defined(ENABLE_VULKAN)
return Settings::GraphicsAPI::Vulkan;
#endif
// ...Otherwise negotiate with the RetroArch frontend as usual
// Attempt to use the renderer recommended by the frontend if possible
retro_hw_context_type context_type = RETRO_HW_CONTEXT_OPENGL;
environ_cb(RETRO_ENVIRONMENT_GET_PREFERRED_HW_RENDER, &context_type);
switch (context_type) {
@ -80,7 +87,7 @@ Settings::GraphicsAPI GetPreferredRenderer() {
default:
break;
}
// we can't maintain the current driver, need to switch
// We can't get a recommendation from the frontend, so fall back to whatever's available
#if defined(ENABLE_VULKAN)
return Settings::GraphicsAPI::Vulkan;
#elif defined(ENABLE_OPENGL)

View File

@ -105,6 +105,36 @@
<string>10x Native (4000x2400)</string>
</property>
</item>
<item>
<property name="text">
<string>11x Native (4400x2640)</string>
</property>
</item>
<item>
<property name="text">
<string>12x Native (4800x2880)</string>
</property>
</item>
<item>
<property name="text">
<string>13x Native (5200x3120)</string>
</property>
</item>
<item>
<property name="text">
<string>14x Native (5600x3360)</string>
</property>
</item>
<item>
<property name="text">
<string>15x Native (6000x3600)</string>
</property>
</item>
<item>
<property name="text">
<string>16x Native (6400x3840)</string>
</property>
</item>
</widget>
</item>
</layout>

View File

@ -498,8 +498,11 @@ struct Values {
Setting<bool> apply_region_free_patch{true, Keys::apply_region_free_patch};
// Renderer
// clang-format off
SwitchableSetting<GraphicsAPI, true> graphics_api{
#if defined(ENABLE_OPENGL)
#if defined(ANDROID) && defined(ENABLE_VULKAN) // Prefer Vulkan on Android, OpenGL on everything else
GraphicsAPI::Vulkan,
#elif defined(ENABLE_OPENGL)
GraphicsAPI::OpenGL,
#elif defined(ENABLE_VULKAN)
GraphicsAPI::Vulkan,
@ -510,6 +513,7 @@ struct Values {
#error "At least one renderer must be enabled."
#endif
GraphicsAPI::Software, GraphicsAPI::Vulkan, Keys::graphics_api};
// clang-format on
SwitchableSetting<u32> physical_device{0, Keys::physical_device};
Setting<bool> use_gles{false, Keys::use_gles};
Setting<bool> renderer_debug{false, Keys::renderer_debug};
@ -529,7 +533,7 @@ struct Values {
SwitchableSetting<bool> use_display_refresh_rate_detection{
true, Keys::use_display_refresh_rate_detection};
Setting<bool> use_shader_jit{true, Keys::use_shader_jit};
SwitchableSetting<u32, true> resolution_factor{1, 0, 10, Keys::resolution_factor};
SwitchableSetting<u32, true> resolution_factor{1, 0, 16, Keys::resolution_factor};
SwitchableSetting<bool> use_integer_scaling{false, Keys::use_integer_scaling};
SwitchableSetting<double, true> frame_limit{100, 0, 1000, Keys::frame_limit};
SwitchableSetting<double, true> turbo_limit{200, 0, 1000, Keys::turbo_limit};