-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use EGL over GLX #15286
Use EGL over GLX #15286
Conversation
No-one should use GLX,.. I just had talk about GLX/EGL subject on XDC24 few days ago. I assume the SDL2 revert is not meant to remain at time of merge? |
When we're using SDL2 it will handle the GL context for us (and I bet it already uses EGL). |
I wonder if FSAA will still work with this. |
On my system FSAA doesn't work with this (just like SDL). I'm not sure why and couldn't quickly figure it out. 🤷 |
I had looked briefly in the past. While it's logically not that hard to add, I found it incredibly tedious and obtuse in Irrlicht. |
@lhofhansl actually I think the root cause is just #13397 and it's just a weird accident that it still worked with GLX. |
I don't mean to say that that should block this PR. That said, with some larger viewing ranges the experience without FSAA is really shitty and SSAA is just too slow (and FXAA does not deal with geometry aliasing at all). |
Tested on Linux, works well for me (disabled SDL2, Wayland + Xwayland) |
Adding to milestone since this is at the very least a maintenance improvement and could potentially fix the game not launching. |
Am I the only one who uses large viewing_ranges and finds the geometry aliasing effects causing moire patterns grating? It looks like a cheap, bad game from the early 2000s. IMHO there is no alternative really... Well other than rendering at a lower geometry resolution at a distance, perhaps with some LOD. Oh, and for #13397 I added the ability to disable post-processing. FSAA does work with shaders, just not with post-processing (unless said PP takes multi-sampled textures into account) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on Linux non-SDL X11
Enabled settings: shadows + post processing + debanding enabled.
Intel HD, i915, OpenGL 4.6. Values of antialiasing
:
none
: worksfsaa
(16): "works" but looks likenone
ssaa
produces a black screen. No errors. [1]fxaa
: antialiasing works
AMD Polaris, amdgpu, OpenGL 4.6. Values of antialiasing
:
none
: worksfsaa
(16): "works" but looks likenone
ssaa
produces a black screen. No errors. [1]fxaa
: antialiasing works
[1] Disabling post-processing or shaders altogether can get it to "work", but it looks like none
.
Furthermore (not relevant for this PR), I noticed that the Debian package libgl1-mesa-dev
is now a placeholder for transition. libegl-dev
is now required. libopengl-dev
is technically optional, but CMake fails to find libOpenGL.so.0
on its own if that's missing.
I also found an interesting performance issue when using test_pr_15286.mp4 |
FSAA definitely works for me, on Intel integrated graphics and NVidia, and it make a huge difference. FSAA and SSAA both handle geometry aliasing. (And so FSAA does not help with texture aliasing, and FXAA does not help with geometry aliasing). SSAA of course is best, but it's also by far the slowest - unusable even with my NVidia card. |
Now I'm getting these warnings at startup:
|
And now it's hanging at startup with a black window and this backtrace:
Commit d52e4cd, and it's fixed when I revert aa27311 It only happens if I start it via the desktop file after |
I get an immediate Segmentation fault now with the NVidia driver (not Intel) I thought we get an option to switch back to GLX. My fault I did not actually check, but no option to keep using GLX is not acceptable. @sfan5 |
Works fine with aa27311 reverted. |
Ok then let's not invest more time into legacy shit.
There is absolutely no reason to ever use GLX anymore. |
For the xcb, looks very similar to https://gitlab.freedesktop.org/xorg/lib/libxcb/-/issues/38 . Going back to GLX seriously doesn't make sense, just workarounding buggy X11 should be enough |
It doesn't matter, because when we finally enable SDL (permanently) all this legacy code that directly deals with X11 or GLX can be deleted. |
I am pretty sure upstream Luanti has mostly already done this on **all its X11-based official targets**, but I did not yet do this to Luanti-on-TUR because I have not had time to finish fixing + testing this mode. In particular I believe that this mode has a unique potential to possibly engage with twaik's `termux-wsi-layer` and possibly benefit from an extremely huge performance boost on some specific devices, if it can be made to work with it. termux/termux-packages#22353 However, unfortunately right now when I try to use this PR with `termux-wsi-layer` installed on a device where it works with `glmark2-es2`, I see this error ``` Thread 1 "luanti" received signal SIGSEGV, Segmentation fault. 0x0000007fad9782b0 in XGetVisualInfo () from /data/data/com.termux/files/usr/lib/libX11.so (gdb) bt from /data/data/com.termux/files/usr/lib/libX11.so config=0xb400007d1ca54f00, attribute=12334, value=0x7fffffd464) at /data/data/com.termux/files/home/termux-packages/packages/termux-wsi-layer/egl.c:133 this=0xb400007daca1c9b0) at /data/data/com.termux/files/home/.termux-build/luanti/src/irr/src/CEGLManager.cpp:185 this=this@entry=0xb400007ddca220d0) at /data/data/com.termux/files/home/.termux-build/luanti/src/irr/src/CIrrDeviceLinux.cpp:414 this=0xb400007ddca220d0, param=...) at /data/data/com.termux/files/home/.termux-build/luanti/src/irr/src/CIrrDeviceLinux.cpp:166 at /data/data/com.termux/files/home/.termux-build/luanti/src/irr/src/Irrlicht.cpp:66 at /data/data/com.termux/files/home/.termux-build/luanti/src/src/client/renderingengine.cpp:151 receiver=0xb400007d9ca1d630) at /data/data/com.termux/files/home/.termux-build/luanti/src/src/client/renderingengine.cpp:206 at /data/data/com.termux/files/home/.termux-build/luanti/src/src/client/clientlauncher.cpp:290 cmd_args=...) at /data/data/com.termux/files/home/.termux-build/luanti/src/src/client/clientlauncher.cpp:98 at /data/data/com.termux/files/home/.termux-build/luanti/src/src/main.cpp:264 (gdb) ``` `0001-force-egl-priority-over-glx.patch`: this is luanti-org/luanti#15286 but applied to Luanti-on-TUR `0005-toggle-on-the-recent-migration-away-from-sdl2.patch`: this is luanti-org/luanti#15284 but applied to Luanti-on-TUR `0006-fix-incompatible-type-ekey-code.patch`: I wrote this, this is necessary to fix a minor build error when SDL2 is disabled in Luanti
I am pretty sure upstream Luanti has mostly already done this on **all its X11-based official targets**, but I did not yet do this to Luanti-on-TUR because I have not had time to finish fixing + testing this mode. In particular I believe that this mode has a unique potential to possibly engage with twaik's `termux-wsi-layer` and possibly benefit from an extremely huge performance boost on some specific devices, if it can be made to work with it. termux/termux-packages#22353 However, unfortunately right now when I try to use this PR with `termux-wsi-layer` installed on a device where it works with `glmark2-es2`, I see this error ``` Thread 1 "luanti" received signal SIGSEGV, Segmentation fault. 0x0000007fad9782b0 in XGetVisualInfo () from /data/data/com.termux/files/usr/lib/libX11.so (gdb) bt from /data/data/com.termux/files/usr/lib/libX11.so config=0xb400007d1ca54f00, attribute=12334, value=0x7fffffd464) at /data/data/com.termux/files/home/termux-packages/packages/termux-wsi-layer/egl.c:133 this=0xb400007daca1c9b0) at /data/data/com.termux/files/home/.termux-build/luanti/src/irr/src/CEGLManager.cpp:185 this=this@entry=0xb400007ddca220d0) at /data/data/com.termux/files/home/.termux-build/luanti/src/irr/src/CIrrDeviceLinux.cpp:414 this=0xb400007ddca220d0, param=...) at /data/data/com.termux/files/home/.termux-build/luanti/src/irr/src/CIrrDeviceLinux.cpp:166 at /data/data/com.termux/files/home/.termux-build/luanti/src/irr/src/Irrlicht.cpp:66 at /data/data/com.termux/files/home/.termux-build/luanti/src/src/client/renderingengine.cpp:151 receiver=0xb400007d9ca1d630) at /data/data/com.termux/files/home/.termux-build/luanti/src/src/client/renderingengine.cpp:206 at /data/data/com.termux/files/home/.termux-build/luanti/src/src/client/clientlauncher.cpp:290 cmd_args=...) at /data/data/com.termux/files/home/.termux-build/luanti/src/src/client/clientlauncher.cpp:98 at /data/data/com.termux/files/home/.termux-build/luanti/src/src/main.cpp:264 (gdb) ``` `0001-force-egl-priority-over-glx.patch`: this is luanti-org/luanti#15286 but applied to Luanti-on-TUR `0005-toggle-on-the-recent-migration-away-from-sdl2.patch`: this is luanti-org/luanti#15284 but applied to Luanti-on-TUR `0006-fix-incompatible-type-ekey-code.patch`: I wrote this, this is necessary to fix a minor build error when SDL2 is disabled in Luanti
…l its X11-based official targets**, but I did not yet do this to Luanti-on-TUR because I have not had time to finish fixing + testing this mode. `0001-force-egl-priority-over-glx.patch`: this is luanti-org/luanti#15286 but applied to Luanti-on-TUR `0005-toggle-on-the-recent-migration-away-from-sdl2.patch`: this is luanti-org/luanti#15284 but applied to Luanti-on-TUR `0006-fix-incompatible-type-ekey-code.patch`: I wrote this, this is necessary to fix a minor build error when SDL2 is disabled in Luanti
I am pretty sure upstream Luanti has mostly already done this on **all its X11-based official targets**, but I did not yet do this to Luanti-on-TUR because I have not had time to finish fixing + testing this mode. `0001-force-egl-priority-over-glx.patch`: this is luanti-org/luanti#15286 but applied to Luanti-on-TUR `0005-toggle-on-the-recent-migration-away-from-sdl2.patch`: this is luanti-org/luanti#15284 but applied to Luanti-on-TUR `0006-fix-incompatible-type-ekey-code.patch`: I wrote this, this is necessary to fix a minor build error when SDL2 is disabled in Luanti
I am pretty sure upstream Luanti has mostly already done this on **all its X11-based official targets**, but I did not yet do this to Luanti-on-TUR because I have not had time to finish fixing + testing this mode. `0001-force-egl-priority-over-glx.patch`: this is luanti-org/luanti#15286 but applied to Luanti-on-TUR `0005-toggle-on-the-recent-migration-away-from-sdl2.patch`: this is luanti-org/luanti#15284 but applied to Luanti-on-TUR `0006-fix-incompatible-type-ekey-code.patch`: I wrote this, this is necessary to fix a minor build error when SDL2 is disabled in Luanti
I am pretty sure upstream Luanti has mostly already done this on **all its X11-based official targets**, but I did not yet do this to Luanti-on-TUR because I have not had time to finish fixing + testing this mode. `0001-force-egl-priority-over-glx.patch`: this is luanti-org/luanti#15286 but applied to Luanti-on-TUR `0005-toggle-on-the-recent-migration-away-from-sdl2.patch`: this is luanti-org/luanti#15284 but applied to Luanti-on-TUR `0006-fix-incompatible-type-ekey-code.patch`: I wrote this, this is necessary to fix a minor build error when SDL2 is disabled in Luanti
only affects the legacy CIrrDeviceLinux.
GLX is quite old and EGL is the "new" standard for this.
this change could fix some problems people have been having.
To do
This PR is technically ready.
Note: this should be tested on Linux/Intel, Linux/AMD and Linux/NVIDIA before merge!