Jump to content
Faalagorn

Wayland support (Linux) and Vulkan renderer

Recommended Posts

I haven't look very thoroughly whether or not it's possible to add those by manually replacing repsective files from LWJGL, but how hard would be adding support for Wayland on Linux and Vulkan renderer that are provided by LWJGL? I don't know what version of LWJGL PZ currently uses, but Wayland is there since LWJGL 3.1.4 (Nov 20, 2017)  and Vulkan since LWJGL 3.0.0 (Jun 3, 2016)? https://github.com/LWJGL/lwjgl3/releases

 

Both could help with performance on respective platforms (Vulkan is not supported on Mac officially, though they can use MoltenVK for potentially better performance especially as OpenGL is currently being phased out from Macs in favor of Metal) while Wayland could help on newer Linux distros as it's slowly gaining more and more mainstream attention.

Share this post


Link to post
Share on other sites

Probably impossible as the game currently stands -- it's still running on LWJGL 2 after it was discovered that there were a ton of OpenGL related errors trying to convert it over in the controller test build (it's also why we still have the alt+tab crash on select hardware/configs). In order to even diagnose those errors, rewriting part of the game's rendering code to utilize a scene graph is necessary. Why? I won't even pretend to understand it.  A useful tool for debugging OpenGL was also bought out and abandoned some years ago, so there's no good option aside from upgrading, anymore.

 

I've seen a few other open-source implementations of Vulkan and Metal for JWLGJ as well as the one linked, but I don't know how far they got with it. But, because most of those are based on LWJGL3, they can't easily be swapped into the game, anyway.

 

Personally, I think the real moral of the story is 'don't use OpenGL directly for your game project; use a api that supports multiple graphics apis from the beginning." But that's hindsight for you.

Share this post


Link to post
Share on other sites
2 minutes ago, EnigmaGrey said:

Probably impossible as the game currently stands -- it's still running on LWJGL 2 after it was discovered that there were a ton of OpenGL related errors trying to convert it over in the controller test build (it's also why we still have the alt+tab crash on select hardware/configs). In order to even diagnose those errors, rewriting part of the game's rendering code to utilize a scene graph is necessary.   Why? I won't even pretend to understand it.  A useful tool for debugging OpenGL was also bought out and abandoned, so fml.

 

I've seen a few other open-source implementations of Vulkan and Metal for JWLGJ as well as the one linked, but I don't know how far they got with it. But, because most of those are based on LWJGL3, they can't easily be swapped into the game, anyway.

Oh, so the controller test was running LWJGL3? Or were you trying to do it, but abandoned it quickly? I didn't have occasion to test it, as it was Windows only, but if it was, the wiki says the controller improvements are planned toward 42, is it still the case?

 

Anyway, it's fine if sticking to LWJGL2 is a technical barrier for now, maybe one day someone figures it out but in the meantime, it would require too much effort I guess with other pressing matters to solve before the game release. :)

Share this post


Link to post
Share on other sites
1 minute ago, Faalagorn said:

Oh, so the controller test was running LWJGL3? Or were you trying to do it, but abandoned it quickly? I didn't have occasion to test it, as it was Windows only, but if it was, the wiki says the controller improvements are planned toward 42, is it still the case?

 

Anyway, it's fine if sticking to LWJGL2 is a technical barrier for now, maybe one day someone figures it out but in the meantime, it would require too much effort I guess with other pressing matters to solve before the game release. :)

It should be running LJWLG 3, from what I remember. It was just prone to error and limited to Windows only, with no way to debug the OpenGL side.

Share this post


Link to post
Share on other sites
On 6/28/2020 at 4:22 PM, EnigmaGrey said:

It should be running LJWLG 3, from what I remember. It was just prone to error and limited to Windows only, with no way to debug the OpenGL side.

Out of curiosity, I tried the controllertest build for the first time on Linux – I'm not sure how the files are compared to Windows depot (I should have checked), but it works and upon adding         "-Dorg.lwjgl.glfw.libname=glfw_wayland" line, to the appopriate place in ProjectZomboid64.json, it didn't work, but due to the error:

 

ERROR: General, 1593934335478> [LWJGL] GLFW_PLATFORM_ERROR error
ERROR: General, 1593934335478> 	Description : Wayland: Setting window icon not supported
ERROR: General, 1593934335478> 	Stacktrace  :
ERROR: General, 1593934335478> 		ERROR: General, 1593934335479> org.lwjgl.glfw.GLFW.nglfwSetWindowIcon(GLFW.java:2036)
ERROR: General, 1593934335479> 		ERROR: General, 1593934335479> org.lwjgl.glfw.GLFW.glfwSetWindowIcon(GLFW.java:2068)
ERROR: General, 1593934335479> 		ERROR: General, 1593934335479> org.lwjglx.opengl.Display.create(Display.java:139)
ERROR: General, 1593934335479> 		ERROR: General, 1593934335479> org.lwjglx.opengl.Display.create(Display.java:92)
ERROR: General, 1593934335479> 		ERROR: General, 1593934335479> zombie.core.Core.init(Core.java:2244)
ERROR: General, 1593934335479> 		ERROR: General, 1593934335479> zombie.GameWindow.InitDisplay(GameWindow.java:386)
ERROR: General, 1593934335480> 		ERROR: General, 1593934335480> zombie.core.opengl.RenderThread.renderLoop(RenderThread.java:110)
ERROR: General, 1593934335480> 		ERROR: General, 1593934335480> zombie.gameStates.MainScreenState.main(MainScreenState.java:222)

While I don't know how to check whether it's running LWJGL 3 on Linux and Wayland doesn't work, it seems something that's potentially fixable and possible to get working?

Share this post


Link to post
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.
Note: Your post will require moderator approval before it will be visible.

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.

Loading...

×
×
  • Create New...