-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
OpenXR: Add support for Wayland on Linux #97771
Conversation
fcd948a
to
38f18e6
Compare
01c3299
to
21617c1
Compare
21617c1
to
256699e
Compare
This is working for me locally now! I tested with the "Pop" desktop on Wayland, together with the Monado runtime. If anyone wants to test themselves, you'll need to:
You should be able to see output in the console that you ran the game from to indicate that it's using Monado, Wayland and EGL, for example, this is what I see:
|
Thank you! Unfortunately it seems like I can't test this PR properly because my setup does not support the So testing wise I'll limit myself by saying that I can confirm that it fixes the I'm a bit tired so if you don't see me officially approving it now I'll do so tomorrow after taking a closer look. |
#include "thirdparty/glad/glad/egl.h" | ||
#else | ||
#include <EGL/egl.h> | ||
#endif // GLAD_ENABLED |
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.
I wonder if we should one day put this block into some shared include, like we did with other GL-related stuff.
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.
Yeah, that'd be nice: this same "glad/egl.h" vs "EGL/egl.h" is done in a couple other places. It's always tricky with platform includes, though.
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.
I suppose we can do this in a separate PR sometime
static XrGraphicsBindingOpenGLXlibKHR graphics_binding_gl; | ||
#endif | ||
#ifdef EGL_ENABLED |
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.
If I understand correctly this include means that the XR_MNDX_egl_enable
extension will be handled also on X11, although it will only be used with the Wayland backend, right?
Are there plans of using this extension also with X11 or other EGL-enabled gl managers, like the ANGLE ones?
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.
If I understand correctly this include means that the XR_MNDX_egl_enable extension will be handled also on X11, although it will only be used with the Wayland backend, right?
Yes, on Linux we'll include the code for initializing OpenXR on both GLX and EGL, but only actually use the EGL version if we're on Wayland.
Are there plans of using this extension also with X11 or other EGL-enabled gl managers, like the ANGLE ones?
I haven't tested this (I should!) but I don't think OpenXR will be able to correctly initialize with ANGLE, because the OpenXR runtime will be using "real EGL", but we'll be passing it handles (EGLDisplay
, EGLConfig
, etc) from ANGLE, which I think it'll just see as invalid.
But I'll give it a test when I have a chance!
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.
All right. This is absolutely not blocking. Just a curiosity :D
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.
I don't really know the OpenXR API that well so TIWAGOS but everything looks fine! Thank you for fixing this issue, now "full-featured" Wayland-only builds are a thing!
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.
Buildsystem/CI changes check out 👍
Thanks! |
Adds support for initializing OpenXR with Wayland on Linux.
Some notes about the OpenXR side of this:
QWERTY_ENABLE=1 OXR_DEBUG_GUI=1 monado-service
it works as an OpenXR "simulator", where it'll show what the headset sees in a window and allow you to use keyboard and mouse to control the virtual headsetXR_MNDX_egl_enable
extension, but only for Wayland on Linux. Even though we'd theoretically be able to use it with X11 when EGL is used, or on Android, the other extensions we use for supporting those platforms work on more OpenXR runtimes (and even work with Monado too).TODO:Actually test it! My local machine currently uses the proprietary nvidia drivers with X11 - I'll need to get Wayland going :-)Support compiling withx11=no
Assuming I get the 2nd point going, this will supersede PR #73504Supersedes #73504
Bugsquad edit: fixes #70199