xwayland glamor renders incorrectly on nvidia
xwayland windows appear misrender on all wayland compositors when using nvidia hardware. The errors for gnome/plasma can best be described as rendering the wrong frame (perhaps an earlier frame in the swapchain?) which appears visually as sort of doubling of moving objects or as high frequency judder. wlroots/sway manifest this as a partially rendered frame where some portion of the frame is transparent(sometimes 1-3 lines of the frame are missing, or sometimes 50% of the lines in a frame are missing) sometimes even affecting non-xwayland windows such as those on a 2nd display.
This misrender only occurs when rendering frames that take a significant amount of time to render, such as games. Simple scenes which can be rendered well within the time budget of a monitor refresh will not exhibit this issue (such as glxgears at X000 fps). It is simple to reproduce if you have any program which spends significant time in opengl/vulkan rendering frames (lets say at least 10ms gpu time per frame based on tests in Path of Exile), otherwise I suppose it may be hard to replicate as the issue doesnt occur much when frame times are well within one monitor refresh time.
This misrendering can be fixed on all platforms by disabling glamor support via
XWAYLAND_NO_GLAMOR. Without glamor things run much slower but result in frames that are consistent with rendering on X11 directly. I suspect this is an xwayland issue and not a bug in all compositors, but this is just my guess.
- xwayland 22.1.0
- nvidia 510.54
- elg-wayland 1.1.9+ (commit 582b2d3)
- Sway/wlroots head (sway commit b38b845c, wlroots commit e279266f)
- gnome shell/mutter 41.4
- plasma desktop/kwin 5.24.2