Skip to content

Add [SameObject] to all applicable readonly attributes #599

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

Merged
merged 1 commit into from
Apr 22, 2019

Conversation

Manishearth
Copy link
Contributor

Fixes #588

There are only two non-primitive readonly attributes that this does not affect:

  • XRSession.renderState: This can be updated with updateRenderState()
  • XRBoundedReferenceSpace.boundsGeometry: I'm unsure if this array can be updated if settings change

r? @toji

index.bs Outdated
readonly attribute XRLayer? baseLayer;
readonly attribute XRPresentationContext? outputContext;
[SameObject] readonly attribute XRLayer? baseLayer;
[SameObject] readonly attribute XRPresentationContext? outputContext;
Copy link
Member

Choose a reason for hiding this comment

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

These two attributes are the only ones I question in this change, because it implies that each time the render state changes the session attribute will be a new object. That's actually not a bad assumption to make, and it's probably preferable to having XRRenderState be a live object, but I'd like to get that clearly defined one way or the other in the spec prior to adding a dependency on that behavior here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, hm, that's fair. I'll remove that and file an issue

@toji
Copy link
Member

toji commented Apr 22, 2019

Looks great, thank you! I have one change request but otherwise I'm happy to merge this.

You are correct about the boundsGeometry being a live attribute as we have it defined now, by the way.

@Manishearth
Copy link
Contributor Author

Done.

@Manishearth
Copy link
Contributor Author

Should I leave a note on XRBoundedReferenceSpace that boundsGeometry may change?

Also I added in two uncommitted SameObject changes that I'd forgotten to push: context and framebuffer on XRWebGLLayer. Does that sound correct?

@toji
Copy link
Member

toji commented Apr 22, 2019

Hm......... context should be safe, but I'm actually not sure about framebuffer. Let me look into that a bit.

@Manishearth
Copy link
Contributor Author

Yeah, I was a bit iffy about that one too

@toji
Copy link
Member

toji commented Apr 22, 2019

Nope, actually framebuffer should be fine because while the attachments need to swap out on a per-frame basis the framebuffer itself can be a single object throughout! And with that in mind I think I'll merge this now. Thank you!

@toji toji merged commit 5b443a5 into immersive-web:master Apr 22, 2019
@toji toji added this to the May 2019 Working Draft milestone Apr 22, 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.

Mark up readonly attributes with [SameObject] wherever applicable
2 participants