Skip to content

r_waylandcompat should be deprecated in favor of EGL_EXT_present_opaque #426

@Yamagi

Description

@Yamagi

The fundamental problem here is that Doom 3 sets the alpha bits for some assets, most notably the menu and some in game GUIs. With GLX these are pseudotransparent to the background of the GL context, the clear color or something similar. With EGL they're transparent in the literal sense of the word, leading to all kind on interesting render problems. As a work around r_waylandcompat was added. When enabled, the alpha bits of the GL context are forced to 0. While this solves the direct problem, it causes a lot of other render problems... At least on Gnome 4.41 with r_waylandcompat 0 the game is playable, with r_waylandcompat 1 it's more or less broken.

Luckily there's a solution for this. Mesa 21.3.0 added the EGL_EXT_present_opaque extension which can be used to force the presentation thing to be opaque. That's the same behavior as GLX had. And SDL 2.0.18 will support it. It's exposed by the SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY hint, set to SDL_TRUE by default. Nvidia already said that they also support that EGL extension. I don't know if they've already implemented it or if it will be part of later update.

So: Let's remove r_waylandcompat, it does more harm than good. Users who run the game under wayland (which must be forced by setting SDL_VIDEODRIVER=wayland aynway) should use an up to date Mesa and SDL instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions