Jump to content
The Dark Mod Forums

Wayland compatible engine for Linux users


MirceaKitsune

Recommended Posts

This was discussed briefly on Discord some time ago, I wanted to bring it up here as well for consistency. I don't believe it's an emergency but do consider it an important change especially later down the road, as Linux is slowly moving away from x11 with many distros already going full Wayland by default. In my case I'm pretty much waiting for KDE Plasma to fix a few bugs left with the DE before permanently switching from X11 to wayland too, I might be able to make use of it rather soon if they do.

With the new input and rendering system introduced after 2.09 and available for testing in the dev builds (GLFW) we're on our way to having a Wayland compatible build of our engine. Meaning the engine is able to render natively to the WL pipeline, without having to go through the fake x11 server simulated by the Wayland session for compatibility with X exclusive apps. This not only offers proper compatibility for Wayland users, but may improve performance on various fronts which was one of the goals of the new rendering framework.

From what I remember @cabalistic telling me, we can't have the same engine for both x11 and Wayland: It must be compiled against different system packages to produce one version or the other. For Linux users the installer may need to offer two engine binaries in this case, or an option to pick which version you'd like to install if that's better. Other than that I understand it should be able to produce in theory, as SDL2 and GLFW both offer Wayland compatible libraries to compile the engine against. I'm not familiar with the C++ code in the slightest so I'll let the experienced developers complete this with the proper technical additions.

Link to comment
Share on other sites

I don't understand the rationale.

There is X system, and there is Wayland.
The programs written for Wayland don't work in X system.
The programs written for X system work in Wayland via compatibility layer.

Given that we cannot combine both systems in one build, relying on X system sounds like the best solution.

Link to comment
Share on other sites

12 hours ago, stgatilov said:

I don't understand the rationale.

There is X system, and there is Wayland.
The programs written for Wayland don't work in X system.
The programs written for X system work in Wayland via compatibility layer.

Given that we cannot combine both systems in one build, relying on X system sounds like the best solution.

Exactly. Like you said though, running the engine on Wayland requires the X compatibility layer, which is a just that: A compatibility layer. Being able to use the features of Wayland natively is the safe route for the future, and from my understanding it may result in better performance thanks to the improved rendering pipeline.

But I wish to clarify I didn't open this thread to say "do it now"! Also Cabalistic said he doesn't want to bother with it which I respect, if other developers want to let us know. I wanted the discussion to be existent and kept alive for now, since at least in the future this will likely become important depending on which direction Linux goes.

From articles I remember reading a few months ago, some Linux distributions already went Wayland exclusive, meaning they offer the WL session by default when installed. So it replacing X11 is already happening for some distros, we are still in a transition period. X11 should of course remain the default base, that's still the standard for a long time: If the team figures out the process to compile the Wayland engine, it should remain a secondary option especially for now when we'd do initial early testing.

Link to comment
Share on other sites

  • 1 month later...
On 8/10/2021 at 7:03 PM, MirceaKitsune said:

I don't believe it's an emergency but do consider it an important change especially later down the road, as Linux is slowly moving away from x11 with many distros already going full Wayland by default.

I am all-in pro Wayland as it finally does GUI separation, which indeed is essential for desktop security when applications are expected to contain security-relevant bugs...

But that feature doesn't actually require TDM to be Wayland-aware to work.
And Wayland support would increase the maintenance burden.

Is the wrapper actually affecting performance significantly on low-end hardware which runs TDM just fine without Wayland?
Is TDM more likely to crash when running on the X wrapper?

Edited by Abusimplea
Link to comment
Share on other sites

8 minutes ago, Abusimplea said:

Is the wrapper actually affecting performance significantly on low-end hardware which runs TDM just fine without Wayland?

Both systems do not control OpenGL in any way, then only give "primary framebuffer" and control final image compositing. OpenGL rendering should work equally well on both systems. Maybe some specifics around compositing can add one excessive framebuffer copy in one of the cases, but it won't change much (except on integrated GPU maybe, which is too bad to play TDM comfortably).

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 0 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...