Merge branch 'master' into master

This commit is contained in:
bug 2026-04-08 22:02:28 +01:00 committed by GitHub
commit 70d51b3363
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 21 additions and 9 deletions

View File

@ -504,8 +504,9 @@ object NativeLibrary {
const val ErrorSystemFiles = 8
const val ErrorSavestate = 9
const val ErrorArticDisconnected = 10
const val ShutdownRequested = 11
const val ErrorUnknown = 12
const val ErrorN3DSApplication = 11
const val ShutdownRequested = 12
const val ErrorUnknown = 13
fun newInstance(resultCode: Int): EmulationErrorDialogFragment {
val args = Bundle()

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

@ -5,13 +5,13 @@
android:id="@+id/coordinator_about"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:background="?attr/colorSurface">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar_about"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
android:layout_height="wrap_content">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar_system_files"

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

@ -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};