You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enabling WebXR OpenXR backend in servoshell #32809
Currently servoshell uses the glwindow backend by default. Could we enable the OpenXR backend as well? I've done this locally while working on the WebXR crate so far, so the main changes would be:
Controlling the selected backend by pref (dom.webxr.glwindow.enabled or dom.webxr.openxr.enabled), with priority still given to GlWindow if desired.
Making the XR discovery object into an enum for glwindow or openxr
The one other consideration for it (which I haven't addressed locally) is that it would only be for Windows as long as the OpenXR backend relies on D3D11.
I think the second seems better. But since you are the main developer working on webxr part recently, I feel like it's okay to update servoshell directly with OpenXR backend. Maybe we can even create another window xrwindow apart from headedwindow and headlesswindow. So you don't need to always create another headed window before creating a window for WebXR.
But forgive me for not being too familiar with WebXR. What's the OpenXR backend? Is it the same context created from Surfman?
The webxr crate has the concept of backends, interfaces to the runtimes for each respective AR/VR headset. So the OpenXR backend is an interface to the user's OpenXR runtime, which handles taking input from the device that can then be used for rendering. It actually doesn't even need to spawn a new window like the GlWindow backend does, rendering goes directly to the device. It does interface with Surfman, though I'm still not super well versed in the specifics of it. There's a page in the Servo book that helps give a high-level overview of it
How does OpenXR instance get the event? For example, GLWindow is essentially a winit window. So, it can rely on Winit's event loop to get the event and update. The headless window in servoshell implements an event loop that tries to mimic it. If there's a way to get the event from OpenXR, I guess it can communicate with embedder.
Activity
wusyong commentedon Jul 19, 2024
I think the second seems better. But since you are the main developer working on webxr part recently, I feel like it's okay to update servoshell directly with OpenXR backend. Maybe we can even create another window
xrwindowapart fromheadedwindowandheadlesswindow. So you don't need to always create another headed window before creating a window for WebXR.But forgive me for not being too familiar with WebXR. What's the OpenXR backend? Is it the same context created from Surfman?
msub2 commentedon Jul 19, 2024
The webxr crate has the concept of backends, interfaces to the runtimes for each respective AR/VR headset. So the OpenXR backend is an interface to the user's OpenXR runtime, which handles taking input from the device that can then be used for rendering. It actually doesn't even need to spawn a new window like the GlWindow backend does, rendering goes directly to the device. It does interface with Surfman, though I'm still not super well versed in the specifics of it. There's a page in the Servo book that helps give a high-level overview of it
wusyong commentedon Jul 19, 2024
How does OpenXR instance get the event? For example, GLWindow is essentially a winit window. So, it can rely on Winit's event loop to get the event and update. The headless window in servoshell implements an event loop that tries to mimic it. If there's a way to get the event from OpenXR, I guess it can communicate with embedder.