Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve UX when falling back between Display Servers #91780

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Riteo
Copy link
Contributor

@Riteo Riteo commented May 10, 2024

The current UX for DS fallbacks is a bit confusing, as there's quite a bit of (possibly unrelated) errors and then a working game:

Example log from X11 to Wayland
$ DISPLAY=/dev/null bin/godot.linuxbsd.editor.dev.x86_64 --display-driver x11 --rendering-driver opengl3
Godot Engine v4.3.dev.custom_build.1313cd90a (2024-05-09 09:51:35 UTC) - https://godotengine.org
Error loading shared library libXinerama.so.1: No such file or directory
ERROR: X11 Display is not available
   at: DisplayServerX11 (platform/linuxbsd/x11/display_server_x11.cpp:5861)
Your video card drivers seem not to support the required OpenGL 3.3 version.

If possible, consider updating your video card drivers.

If you recently updated your video card drivers, try rebooting.
Plugin "GTK3 plugin" uses conflicting symbol "png_free".
Error loading shared library libspeechd.so.2: No such file or directory
Invalid value (0) for DRI_PRIME. Should be > 0
Inconsistent value (1) for DRI_PRIME. Should be < 1 (GPU devices count). Using: 0
Inconsistent value (2) for DRI_PRIME. Should be < 1 (GPU devices count). Using: 0
Inconsistent value (3) for DRI_PRIME. Should be < 1 (GPU devices count). Using: 0
OpenGL API 4.6 (Core Profile) Mesa 23.3.5 - Compatibility - Using Device: AMD - AMD Radeon Vega 8 Graphics (radeonsi, raven, LLVM 17.0.6, DRM 3.57, 6.8.8)

This patchset1 aims to improve the situation where possible, without introducing any big change yet:

  • From core, we display a warning whenever a fallback is being attempted;

  • From X11, we alert the user about a failed rendering driver initialization only if it was actually attempted;

  • From Wayland we actually implement the aforementioned alerts, as they were missing (oops).

New log when falling back from X11 to Wayland
$ DISPLAY=/dev/null bin/godot.linuxbsd.editor.dev.x86_64 --display-driver x11 --rendering-driver opengl3
Godot Engine v4.3.dev.custom_build.1313cd90a (2024-05-09 09:51:35 UTC) - https://godotengine.org
Error loading shared library libXinerama.so.1: No such file or directory
ERROR: X11 Display is not available
   at: DisplayServerX11 (platform/linuxbsd/x11/display_server_x11.cpp:5842)
WARNING: Display driver x11 failed, falling back to wayland.
     at: setup2 (main/main.cpp:2701)
Plugin "GTK3 plugin" uses conflicting symbol "png_free".
Error loading shared library libspeechd.so.2: No such file or directory
Invalid value (0) for DRI_PRIME. Should be > 0
Inconsistent value (1) for DRI_PRIME. Should be < 1 (GPU devices count). Using: 0
Inconsistent value (2) for DRI_PRIME. Should be < 1 (GPU devices count). Using: 0
Inconsistent value (3) for DRI_PRIME. Should be < 1 (GPU devices count). Using: 0
OpenGL API 4.6 (Core Profile) Mesa 23.3.5 - Compatibility - Using Device: AMD - AMD Radeon Vega 8 Graphics (radeonsi, raven, LLVM 17.0.6, DRM 3.57, 6.8.8)

It's not perfect by any means (the DRI_PRIME stuff is especially annoying), but those were some fairly low-hanging fruits and so this will do in the meantime.

Footnotes

  1. Yes, sorry for making three commits but they feel all equally sensitive and unrelated. Please tell me if a single squashed commit is preferred.

Before it was a bit unclear on what was happening, since a display
server has to fail to fall back and so the user would be left with an
error _and_ a (hopefully) running game.

Should make the experience more pleasant on Linux/BSD now that we have
two display servers.
Riteo added 2 commits May 10, 2024 20:02
Before, they would always complain even if there was no attempt at
initializing them (e.g. because there's no X11 display).

While we're at it, this patch also adds a specific message for OpenGL ES
and rewords "OpenGLES" to "OpenGL ES" in an error, for consistency
(AFAIK we either say "GLES" or "OpenGL ES").
This brings it to parity with the X11 backend.
@Riteo
Copy link
Contributor Author

Riteo commented May 10, 2024

All right I implemented all the suggestions and added an extra EGLManager::open_display check for the GLES driver, in order to make it fail properly if we can't actually open a display instead of failling when creating a window.

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

Successfully merging this pull request may close these issues.

None yet

3 participants