Wayland Vulkan ignores VkCompositeAlphaFlagsKHR

I noticed that today’s driver release includes support for Wayland Vulkan surfaces - thanks so much for adding this!

I did notice, however, that opacity is an issue when the window surface has an alpha channel (who could have guessed that alpha might some day represent opacity!). Normally you can just set VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR to prevent that, but it doesn’t appear to make a difference. OpenGL has the same problem, but that’s already being addressed via EGL_EXT_present_opaque (which is my next most-wanted feature!).

I’ve included two sample images:

flibitAMD shows the correct opaque rendering, while flibitIntelNVIDIA shows the bug in screenshot form (on the actual display it looks closer to the correct image, but the background layer ordering is messed up).

1 Like

Checked just in case: VkSurfaceCapabilitiesKHR.supportedCompositeAlpha is set to 0x1, suggesting it only supports opaque presentation. Commit:


1 Like

Bumping this with a minor update since SDL 2.0.22 is coming out really soon - for testing purposes I’ve pushed a Steam beta of FEZ (appid 224760) which uses the very latest Git revision of SDL and an updated FNA/FNA3D. This is the quickest way to demonstrate the opacity issue and can be seen as soon as it starts fading to the title screen.

By default it uses Wayland and OpenGL, Xwayland can be forced with SDL_VIDEODRIVER=x11 %command% as the Steam launch option and Vulkan can be forced with /gldevice:Vulkan as a launch parameter. Note that the Steam overlay isn’t going to work until it’s fixed on Valve’s end: Add Wayland support to the Steam overlay · Issue #8020 · ValveSoftware/steam-for-linux · GitHub

As of the latest driver and egl-wayland tag, OpenGL now has opaque presentation support! Unfortunately it looks like Vulkan did not get the same treatment. Any chance we can get a Vulkan equivalent for this commit?

I messed around with egl-wayland and came up with a patch to make it work with existing drivers: