libretro / libretro/RetroArch

RFE: Please allow users to set cores context drivers and separate opengl from opengles

Open
#11,257 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
14.1k
Forks
2.2k
Avg merge
7h 35m
Merged PRs (30d)
51

Description

Description

I have a very bad computer and X11 is slower than wayland (or KMS). However disabling x11 and Xwayland consequently is a path to terrible behavior in retroarch. Namely you're forced into a choice where you either have ppsspp running (only works in opengles on wayland or in KMS) and you have beetle falling back to software mode and dolphin thinking it's running on a 'opengl' without support for 'Ext_buffer_storage' (it's actually running opengles).
Or if you chose opengl you get everything but ppsspp.

If you try to enable both kinds (opengl and opengles variants) in the configure, it will not help; first because both entries are under 'gl' in the retroarch driver menu, second because the setting to allow cores to switch the video driver will not work and can even crash in KMS when switching cores without shutting them down first (which is very bad if the crash doesn't take you to the TTY but 'hangs' because the keys to switch TTY are not available in the retroarch menu and then you only can force a shutdown).

Disabling allow cores to switch the video driver can 'help' by forcing the driver to be opengles with the results of the first paragraph above where most cores think they're running a weird opengl and some fallback to software renderer.

I basically want a situation where i can choose the 'real' opengl context in the main menu driver and use 'opengles3' just for ppsspp and not let the cores randomly go thinking that opengles is opengl or other more stupid things. Alternatively fixing PPSSPP so the core doesnt crash when you request a opengl context without xwayland (without x11) would also solve things by being able to use opengl for everything.

Expected behavior

Two problems

1:
The user can't force a core to use a driver. It's all under the hardcoded preference of the core creator and sometimes it's wrong. See for example dolphin in a RA compiled with both opengl and opengles thinking it's already under opengl and not bothering to switch.

2:
Well, opengl and opengles are under the same entry in the drivers, so it's not very surprising if the code got confused about this. This also might make it impossible to allow the user to choose one fixed driver per core.

Actual behavior

You have to read the code or use deductive logic to understand what actual context the driver is running, even if you disable allow cores to switch the video driver; because some cores get confused about opengles and think it's opengl. Moreover you can't choose a fixed driver per core. Not sure if the option for private hardware contexts for core influences this mess.

This basically forces me to keep two retroarch executables.

Steps to reproduce the bug

So many alternatives here, but here is one (in linux with wayland. You can disable wayland and use KMS instead too)

  1. compile RA with --disable-x11 --disable-opengl_core --disable-opengl1 --enable-opengles --enable-opengles3 --enable-opengl --enable-wayland (the two kinds of opengles are because 3 doesn't compile without 1 for include reasons, probably a bug).
  2. turn off allow cores to switch the video driver and choose the gl driver (you don't even know if opengl or opengles is chosen here)
  3. run dolphin on any game, it will complain about Ext_buffer_storage and ask you to update your 'opengl' drivers inanely (or at least it does here).
  4. run beetle psx on any game. It'll fallback to software mode (you kind of know here that the chosen driver when you chose the 'gl' on the driver menu was opengles from deduction).
  5. enable allow cores to switch the video driver which would 'presumably' fix this by making everything but ppsspp use opengl and ppsspp use opengles. You're going to be disappointed.
  6. PPSSPP works, so ppsspp is requesting the opengles context (it just crashes with a assert on opengl without X11). Dolphin has a grey screen with game sound (different from before where it thought the 'forced' driver was a 'opengl' without EXT_buffer_storage) so maybe it recognized that opengles is not 'opengl' this time since it was not forced to use it, and returned a null context, beetle still fallbacks to software.
Bisect Results

[Try to bisect and tell us when this started happening]

Version/Commit

You can find this information under Information/System Information

  • RetroArch: 11719badcb173ee57c960826dad86fe0fa7231df
Environment information
  • OS: Linux AIVAS 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Compiler: gcc 9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Wayland or KMS configuration using the listed configure flags, then trace the driver menu's gl selection and allow cores to switch the video driver behavior. Done means users can distinguish OpenGL from OpenGLES and select a fixed driver per core, or PPSSPP can reliably use the requested OpenGL context without X11.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
computer-graphics, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.