Skip to content
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

Don't check XR compat flag for inline sessions #705

Merged
merged 1 commit into from
Jun 17, 2019

Conversation

Manishearth
Copy link
Contributor

fixes #607

r? @NellWaliczek

@Manishearth
Copy link
Contributor Author

I don't think this is the complete solution. This doesn't address the case where there are multiple inline sessions present, since it invalidates the other inline sessions. A fix for that is to only unset the flag for baseLayer, but that doesn't solve the issue of creating a compatible context and using it for a different device later.

It feels like makeXRCompatible() should take a session parameter and mark the context as compatible for that session only.

Alternatively, we can make inline sessions skip this flag completely. I might just do that.

@Manishearth
Copy link
Contributor Author

Alternatively, we can make inline sessions skip this flag completely. I might just do that.

This was cleaner, ended up doing it.

cc @asajeffrey

@toji
Copy link
Member

toji commented Jun 14, 2019

I don't think this is the right approach. As long as the underlying XR device hasn't changed there's no reason that the compatibility bit would become invalid between one XR session and the next. The only time that this would be problematic is if the XR device is changed, and that should already be covered by the algorithm here: http://localhost:8080/webxr/#select-an-xr-device

In retrospect I'm not sure why we left #607 open, as it likely could have been easily explained and closed.

@Manishearth
Copy link
Contributor Author

In that case should I keep the portion of this PR that ignores the flag for inline sessions?

@Manishearth
Copy link
Contributor Author

Since that's a problem regardless of this.

@cwilso cwilso added this to the July 2019 milestone Jun 17, 2019
@toji
Copy link
Member

toji commented Jun 17, 2019

Editors talked this over and we do want to keep the text about ignoring the flag for inline sessions, but we feel the current context compatibility set/unset logic is correct and should not be changed. If you can refactor the PR to only include the change to the inline check, we'll review it again. Thanks!

@Manishearth
Copy link
Contributor Author

Done!

@Manishearth Manishearth changed the title Unset xrCompatible flags on session shutdown Don't check XR compat flag for inline sessions Jun 17, 2019
Copy link
Member

@toji toji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry. Looks like your PR has merge conflicts due to a copious amount of recent merges from checks notes @Manishearth. To prevent future conflicts please contact the offending contributor and instruct him to stop being so damn productive. 😉

index.bs Outdated
@@ -1605,7 +1605,7 @@ The <dfn constructor for="XRWebGLLayer">XRWebGLLayer(|session|, |context|, |laye
1. Let |layer| be a new {{XRWebGLLayer}}
1. If |session|'s [=ended=] value is <code>true</code>, throw an {{InvalidStateError}} and abort these steps.
1. If |context| is lost, throw an {{InvalidStateError}} and abort these steps.
1. If |context|'s [=XR compatible=] boolean is false, throw an {{InvalidStateError}} and abort these steps.
1. If |context|'s [=XR compatible=] boolean is false and |session|'s [=XRSession/mode=] is not {{XRSessionMode/"inline"}}, throw an {{InvalidStateError}} and abort these steps.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change this to use the [=immersive session=] definition instead, which should be a bit more future-proof.

If |session| is an [=immersive session=] and |context|'s [=XR compatible=] boolean is <code>false</code>, throw an {{InvalidStateError}} and abort these steps.

@Manishearth
Copy link
Contributor Author

🤣

done!

@toji toji merged commit 841e8f7 into immersive-web:master Jun 17, 2019
@toji
Copy link
Member

toji commented Jun 17, 2019

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When a session is shut down, should this clear the xrCompatible flag?
3 participants