Skip to content

android: Default to Vulkan video driver on Android#18832

Open
mattakins wants to merge 1 commit intolibretro:masterfrom
mattakins:android-vulkan-default
Open

android: Default to Vulkan video driver on Android#18832
mattakins wants to merge 1 commit intolibretro:masterfrom
mattakins:android-vulkan-default

Conversation

@mattakins
Copy link
Copy Markdown
Contributor

Description

Android defaults to GL due to preprocessor ordering in configuration.c.
Vulkan enables modern slang shader support and other benefits. Vulkan is widely supported on Android 10+.
Switching video modes is unintuitive, especially to first time users.

Added GL fallback on Vulkan init failure for devices without Vulkan support.

Vulkan enables modern slang shader support and other benefits. Added GL fallback on Vulkan init failure for devices without working Vulkan.
Copy link
Copy Markdown
Member

@RobLoach RobLoach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seem p nice.

@RobLoach RobLoach changed the title Default to Vulkan video driver on Android android: Default to Vulkan video driver on Android Mar 15, 2026
@6lackmag3
Copy link
Copy Markdown
Contributor

While this solution has clear advantages many users may actually experience reduced performance as most devices still show better performance and compatibility when using OpenGL as the video driver. This is especially true for Android TV devices and mobile devices with older GPUs and outdated Vulkan drivers.

@i30817
Copy link
Copy Markdown
Contributor

i30817 commented Mar 16, 2026

I've just yesterday helped someone that had a blackscreens on any core (so its a frontend bug) with gl and worked fine with vulkan, so gl is broken in some android devices (he had a adreno, the logs should still be in cache in the help discord channel).

@hizzlekizzle
Copy link
Copy Markdown
Collaborator

@i30817 were they using the nightly or stable? I think that was actually just fixed in the nightlies a few days ago.l

Nevertheless, I am concerned that vulkan might not be readily available on legacy devices, and in those cases they won't even be able to launch to change it, right? That is, complete lockout (without editing config files manually) on older devices vs inconvenience on newer ones.

@i30817
Copy link
Copy Markdown
Contributor

i30817 commented Mar 16, 2026

It was Git 69a4f0e from the log

If that's before or after that fix I don't know.

Edit checked it, now the handy github hyperlink showed, most definitely before, November of 2025

@i30817
Copy link
Copy Markdown
Contributor

i30817 commented Mar 16, 2026

I'm surprised that retroarch doesnt fallback automatically on boot when a default driver doesnt work, maybe with a startup overlay warning.

@mattakins
Copy link
Copy Markdown
Contributor Author

Nevertheless, I am concerned that vulkan might not be readily available on legacy devices, and in those cases they won't even be able to launch to change it, right? That is, complete lockout (without editing config files manually) on older devices vs inconvenience on newer ones.

The fallback mechanism handles the lockout concern directly. If Vulkan init fails (e.g. libvulkan.so doesn't exist, context creation fails, no GPU support), it hits goto error → video_driver_force_fallback("gl") → saves "gl" to the config file → exits. Next launch automatically uses GL. The user sees one failed launch, not a permanent lockout. I took this from the existing D3D11 fallback pattern on Windows.

While this solution has clear advantages many users may actually experience reduced performance as most devices still show better performance and compatibility when using OpenGL as the video driver. This is especially true for Android TV devices and mobile devices with older GPUs and outdated Vulkan drivers.

Regarding performance — Vulkan has been mandatory on all 64-bit Android 10+ devices since 2019, and any SoC from 2018 onwards has mature Vulkan drivers at this point. The devices with no Vulkan or poor Vulkan implementations are largely pre-2016 hardware or low end Android TV devices.

On those devices, Vulkan init will either fail cleanly and fall back to GL, or the user can switch back to GL in settings. So we are just flipping the inconvenience from the 85% of users who would benefit from Vulkan to the 15% still using legacy devices (see Google Play's Vulkan dashboard for stats).

@hizzlekizzle
Copy link
Copy Markdown
Collaborator

As long as the fallback works, I'm fine with it.

@mattakins
Copy link
Copy Markdown
Contributor Author

As a test, I built RetroArch with Vulkan as the default video driver but with vulkan_init forced to fail immediately to simluate a device with no Vulkan support. On first launch, the fallback kicked in and it exited. On second launch, it came upon GL normally, so the fallback successfully wrote video_driver = "gl" to config. No lockout!

@matheuswillder
Copy link
Copy Markdown

matheuswillder commented Mar 20, 2026

@i30817:

I've just yesterday helped someone that had a blackscreens on any core (so its a frontend bug) with gl and worked fine with vulkan, so gl is broken in some android devices (he had a adreno, the logs should still be in cache in the help discord channel).

This also pops up occasionally on the RetroArch subreddit. Just today I received a comment in a old post thanking me for pointing out the "fix", the fix being simply switching from GL to Vulkan. Edit: link to it: https://www.reddit.com/r/RetroArch/comments/1n5robl/comment/obgjkb5/

@hizzlekizzle:

@i30817 were they using the nightly or stable? I think that was actually just fixed in the nightlies a few days ago.l

If the fix you mentioned is #18758, it covers devices with Snapdragon CPU/Adreno GPU, but other devices also have issues with their OpenGL drivers.

My Samsung device with an Exynos CPU/Xclipse GPU used to show this black screen on any core and simply crash most standalone emulators that used OpenGL. Now after recent system updates, it seems to be using ANGLE. Its compatibility has improved somewhat since then, but it still has graphical bugs and is obviously far behind Vulkan in terms of speed:

Image

@mattakins
Copy link
Copy Markdown
Contributor Author

@LibretroAdmin This is ready for a look when you get a chance. Quick summary:

  • Defaults Android to Vulkan instead of GL
  • If Vulkan init fails, it falls back to GL via video_driver_force_fallback() and persists the change — same pattern as the D3D11 fallback
    on Windows
  • Tested the fallback by forcing Vulkan init to fail: first launch exits, second launch comes up on GL normally, no lockout
  • RobLoach and hizzlekizzle like it

@hizzlekizzle
Copy link
Copy Markdown
Collaborator

We're holding off on some PRs until the stable release, but I think this one probably could/should come before it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants