Bug 389298 - GZDoom (SDL2), at least, run with SDL_VIDEODRIVER=wayland under kwin_wayland experience alpha transparency bleeding weirdness
Summary: GZDoom (SDL2), at least, run with SDL_VIDEODRIVER=wayland under kwin_wayland ...
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.11.95
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-21 22:22 UTC by Kyle Devir
Modified: 2021-10-13 13:09 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
mgraesslin: Wayland+
mgraesslin: X11-


Attachments
GZDoom with background bleeding (2.04 MB, image/png)
2018-01-21 22:22 UTC, Kyle Devir
Details
GZDoom menu with more alpha bleeding (2.00 MB, image/png)
2018-01-21 22:23 UTC, Kyle Devir
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle Devir 2018-01-21 22:22:17 UTC
Created attachment 110034 [details]
GZDoom with background bleeding

I've seen this on GZDoom run with the SDL_VIDEODRIVER=wayland, at least. Xonotic shows no discernible issues, in this regard.

I'm not entirely sure what it is, but it looks vaguely something to do with alpha transparency? It causes what's rendered behind the window to show up.

For a moment, I thought that it might be related to my having the transparency effect enabled, but disabling that changed nothing.
Comment 1 Kyle Devir 2018-01-21 22:23:18 UTC
Created attachment 110035 [details]
GZDoom menu with more alpha bleeding
Comment 2 Kyle Devir 2018-01-21 22:25:17 UTC
Note that this doesn't occur when I run this on Weston. Alpha transparency works as expected.

Running with SDL_VIDEODRIVER=x11 also avoids the problem.
Comment 3 Martin Flöser 2018-01-22 07:57:12 UTC
Is that a free game?
Comment 4 Kyle Devir 2018-01-22 11:20:03 UTC
GZDoom is free, and should be in your distro's repositories.

You can also download the game files for Doom for free from here:

http://doomgod.com/wads/iwads/
Comment 5 Martin Flöser 2018-01-28 09:03:23 UTC
(In reply to Kyle Devir from comment #4)
> GZDoom is free, and should be in your distro's repositories.

By any chance do you know the package name in debian? Searching for doom gives me many things but not gzdoom.
Comment 6 Kyle Devir 2018-01-28 09:58:15 UTC
(In reply to Martin Flöser from comment #5)
> (In reply to Kyle Devir from comment #4)
> > GZDoom is free, and should be in your distro's repositories.
> 
> By any chance do you know the package name in debian? Searching for doom
> gives me many things but not gzdoom.

Didn't realize Debian didn't package it. Precompiled binaries are available, though:

apt-add-repository 'deb http://debian.drdteam.org/ stable multiverse'

Then download and import the gpg key from here:
http://debian.drdteam.org/drdteam.gpg

Then, update and install gzdoom.
Comment 7 Alexander Mentyu 2018-05-18 18:52:49 UTC
Can reproduce alpha transparency bug in Brutal Doom game from AUR https://aur.archlinux.org/packages/brutal-doom/

brutal-doom 21.2018.02.24-1
Plasma: 5.12.5
Apps: 18.04.0
Frameworks: 5.46.0
Qt: 5.10.1
Kernel: 4.14.41-1-MANJARO
OS: Netrunner Rolling
Video: Intel 4400
Driver: xf86-video-intel 1:2.99.917+823+gd9bf46e4-1
Screen: 1600x900
wayland-protocols 1.13-1
wayland 1.14.0-1
Comment 8 Thiago Sueto 2021-01-29 17:48:20 UTC
Hmm, I used the flatpak, set the env var and confirmed it was running on Wayland via xeyes.
It doesn't seem reproducible here.
Comment 9 David Gow 2021-10-02 14:07:52 UTC
This sounds like it's a well-known issue with the game / SDL's understanding of rendering to buffers with alpha channels.

Basically, on X11 the alpha channel was ignored, and on Wayland it's used (to be able to provide nicely alpha-blended windows with interesting shapes, etc). There's been an EGL extension proposed to allow SDL to request the alpha channel is ignored:
https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_present_opaque.txt

SDL already has support for this extension, though it's not yet part of a release:
https://github.com/libsdl-org/SDL/pull/4646

There's an in-progress implementation for Mesa:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12373

So I doubt this is actually a KWin bug, but I could be wrong…
Comment 10 Vlad Zahorodnii 2021-10-13 13:09:26 UTC
Marking as RESOLVED UPSTREAM. FWIW, EGL_EXT_present_opaque patches have been merged in Mesa.