-
Notifications
You must be signed in to change notification settings - Fork 406
Allow inline sessions without requiring the presence of an XR device #704
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
Conversation
Please see my new #635 (comment). More generally, I wonder if the existing "XR Device" concept, which doesn't apply to inline sessions, isn't prone to such issues. @toji |
Personally I feel like for inline sessions we should support a pseudo-XR device or something. This also gives us better control over defining views; for example if your browser is running in XR, the inline session may actually want to expose two views (and then composite the canvas correctly), but the concept of a view comes from the XR device. |
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 think that we probably do want to support the idea of an "inline XR device", but it's likely going to be a bit more complex than that. When the feature request API that Nell's working on lands we'll probably be in a position where developers need to declare up-front which reference spaces they want to use. If they only specify "viewer" (which seems likely to be the default) then a sensorless XR device is totally appropriate, but if the developer indicates that they want to use some level of tracking (like a "local" reference space) then we'd want to first check and see if a "real" device is available that can offer poses. I'd prefer that we see how the feature request API surface lands before diving into that, though.
In the meantime, this tweak to the spec language ensures that we get the intended behavior of inline always being supported, so I support landing it once it's been cleaned up a bit.
(Curious if @NellWaliczek has thoughts on the above?)
Addressed |
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.
LGTM, though it appears that you've got a merge conflict that needs resolving.
I'd like to hear from @NellWaliczek before merging, though.
Rebased. I need to get better at not breaking my own PRs 😛 |
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 think having a dedicated XR device that inline sessions can refer to is important for a number of reasons. Yes, there are spatial tracking implications, but also it would help clarify the difference in session behavior in a number of places.
To be honest, I'm not sure landing this PR without the broader correction is super helpful. Am I missing a reason to try to land this one as-is or can we close this in favor of an overall "add inline XR device" PR?
@@ -281,7 +281,7 @@ When the <dfn method for="XR">supportsSession(|mode|)</dfn> method is invoked, i | |||
1. Run the following steps [=in parallel=]: | |||
1. [=ensures an XR device is selected|Ensure an XR device is selected=]. | |||
1. If the [=XR/XR device=] is null, [=reject=] |promise| with a "{{NotSupportedError}}" {{DOMException}} and abort these steps. | |||
1. If the [=XR/XR device=]'s [=list of supported modes=] does not [=list/contain=] |mode|, [=reject=] |promise| with a "{{NotSupportedError}}" {{DOMException}} and abort these steps. | |||
1. If the [=XR/XR device=]'s [=list of supported immersive modes=] does not [=list/contain=] |mode|, [=reject=] |promise| with a "{{NotSupportedError}}" {{DOMException}} and abort these steps. |
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.
Maybe I'm missing something here... but won't this cause supportsSession('inline')
to be rejected?
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.
Fixed
I'm assuming that we will not have an opportunity to fully address adding an inline XR device prior to the close of the June milestone, and this change would be nice to have in place to make sure our VR complete milestone demonstrates the desired behavior and gives us more leeway to update the implementation details after the fact. |
I think we should land this first as a stopgap, but I can start playing with the idea of a default inline device afterwards. |
Nell asked me to do a sanity check and figure out how many places in the spec we're currently assuming an XR device will always be present when using an inline session. I have to admit, I was a bit surprised at the list:
Mind you that's ONLY places where the text in question may be applicable to inline sessions. There's a bunch of other places where the XR device is referenced but it's only applicable to immersive sessions, or the logic presented naturally allows for avoiding interaction with the XR device, and I haven't included them here. And after dredging all of that up, I've got to say that I'm now on Nell's side of the fence on this one. If we allow for the possibility of no XR device then there's a bunch of logic that, given a strict reading, doesn't make sense. As such the cleaner solution is likely to just full spec out an inline-only XR device that's made available in the absense of actual XR hardware. |
Sounds good, will do. |
Fixes #658, fixes #635
r? @NellWaliczek