Godot's position on Wayland

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By george12teodor

So if you use linux you are probally aware of the “Wayland Revolution”.For those unaware:Wayland is a protocol for a compositor to talk to its clients as well as a C library implementation of that protocol. as cited from https://wayland.freedesktop.org/ ,or in other words,a protocol for creating windows on screen.The main concern around it is that a lot of applications will need to be rewritten for the transition to run smoothly.
My questions are:

  1. What is Godot’s position on Wayland?How well do they support it?(If there is no wayland support when is it coming?)
  2. Are there any bugs or roadblocks preventing the transition from happening?
  3. Are there any performance gains for the engine on Linux or any other advantages of the wayland build of godot?

(Also I am aware this is only important for one platform,if you use windows or mac os you are free to leave or stay here)

Are there any performance gains for the engine on Linux or any other advantages of the wayland build of godot?

XWayland is becoming better and better for gaming lately, which means there probably won’t be much of a performance difference most of the time.

Wayland support is still a goal for Godot in the long term, but we can’t guarantee that it will happen for 4.0.

Calinou | 2021-02-17 17:44

still long way to go - Add Wayland support · Issue #576 · godotengine/godot · GitHub

ivoo56 | 2021-02-27 17:08

:bust_in_silhouette: Reply From: yrtv

You may want to ask this question here: https://forums.developer.nvidia.com/

:bust_in_silhouette: Reply From: Ertain

Wayland support still seems to be far off. There is a proposal, and they’re talking about putting Wayland support in. But there has been little code written. The biggest issues seem to be about nVidia support.

As for nVidia, they have chosen to use the GLX extension, while Wayland uses EGL. Until nVidia switches to EGL, Wayland support is going to be far off.

As for performance gains, I can’t see any (then again, I only use Linux, and I don’t know much about Wayland).

In the long run, wine and wayland are a non issue.

Wine on Wayland: An exciting first update

As for performance gains, I can’t see any (then again, I only use
Linux, and I don’t know much about Wayland).

Wayland is meant to be a boring change. The goal is not more performance but less bugs and ease of development. You will start noticing when Linux desktop advances at a much quicker pace than you are accustomed to.

hungrymonkey | 2021-02-24 03:52

My apologies for writing that. I’ll amend my answer.

Ertain | 2021-02-24 04:35

This is actually no longer the case:

  • EGL was supported by the proprietary NVIDIA drivers for years
  • Wayland already works with NVIDIA drivers since they implemented KMS support

The only remaining issue was that Xwayland did not work with HW acceleration on NVIDIA drivers, so non-Wayland apps on NVIDIA with Wayland were slow.

This has been fixed recently: NVIDIA Prepares XWayland OpenGL/Vulkan Acceleration Support - Phoronix

kisg | 2021-05-04 16:58

:bust_in_silhouette: Reply From: george12teodor

I can’t understand though why you’re adding wine to the whole equation,because from what I am aware of,you don’t need wine to run the godot engine and even when a game made with godot is not available for linux it’s just a few clicks to export to linux,or as a compromise, to export to webgl so that it’s available to most if not all platforms.
I can understand that nVidia’s reluctance to adopt open standards is slowing everything down but can anybody explain why wine is required for wayland support on godot?

can anybody explain why wine is required for wayland support on godot?

The OP might be lazy to release a native Linux port. I think the OP might want to release one binary, an Windows exe, and rely on Proton to support other platforms.

hungrymonkey | 2021-02-24 03:54

can anybody explain why wine is required for wayland support on godot?

The OP might be lazy to release a native Linux port. I think the OP might want to release one binary, an Windows exe, and rely on Proton to support other platforms.

hungrymonkey | 2021-02-24 03:54

My apologies for adding this; it was an accident. I had done a bunch of research (including on how Wine is handling Wayland) and I had mistakenly lump it in with the rest of the discussion.

Ertain | 2021-02-24 04:35

:bust_in_silhouette: Reply From: 404fox

There is a PR for Wayland support, but there is a mix of things that do and don’t work. If you’re interested in contributing:

You’ll have to compile it if you want to try it out.

For your other question:
Aside from requiring less maintenance in the future, one of the inherent advantages of Wayland is that it reduces input latency by cutting out the middle man.

With Xorg, programs tell the X server that they want a window, and then the X server talks to your compositor to get one. Rendering and input must pass through the server.
Under Wayland, programs and compositors can communicate directly without going through a server, therefore reducing latency between an input and result.
Although “DisplayServer” is used in discussions, Wayland is display-server-less. It is only a protocol to make sure all wayland programs and wayland compositors play nice with each other.

The only thing that really holds back Wayland IMO is the lack of interest to push support. Xorg is already stable and works well. But distros that support Wayland by default are few by comparison, and a number of popular programs still don’t support Wayland natively.
Furthermore, if you’re an Nvidia user then you’re going to have issues due to their closed-source drivers, and Nvidia users are a massive portion of the market.

As an Nvidia user having tried GNOME and KDE’s wayland implementations, it is not bug-free and you will absolutely encounter issues in its current state. Less so on GNOME than KDE, but they are still livable. And even though OBS officially supports wayland, it doesn’t work on Nvidia.
I’m planning to get an AMD GPU once prices drop since most of my issues are apparently specific to Nvidia’s drivers.