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

[HoloLens] implement immersive mode #23680

Closed
paulrouget opened this issue Jul 2, 2019 · 20 comments
Closed

[HoloLens] implement immersive mode #23680

paulrouget opened this issue Jul 2, 2019 · 20 comments
Labels

Comments

@jdm
Copy link
Member

@jdm jdm commented Jul 11, 2019

@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Jul 12, 2019

I've managed to get a XAML app that spawns an immersive view, in winrt, with Servo running in a SwapChainPanel: https://github.com/paulrouget/HLServo2

Now trying to create a OpenGL context from a CoreWindow (not foreseeing any issue).

@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Jul 19, 2019

I'm at a point where the HoloLens code is ready to render immersive mode.

I haven't look at webxr yet.

@asajeffrey I haven't looked at the recent work that has been done to hook a different GL context for the immersive mode. Can you point me to the relevant parts of Servo that I should be looking at? And maybe summarize how you think I should implement that? The GL context can run in the compositor thread if necessary, but it doesn't have to. All in the same process.

@jdm I can't find the link to the openxr rust binding you shared. Can you share again?

@Manishearth I'm planning to implement a openxr "driver" for the webxr implementation. Should I just use servo master? Where do I need to implement this driver?

FYI, I'm using https://manishearth.net/sand/webgl-to-webvr/webxr.html , and enabled dom.webxr.enabled. Is that all I need to do?

@Manishearth
Copy link
Member

@Manishearth Manishearth commented Jul 19, 2019

FYI, I'm using https://manishearth.net/sand/webgl-to-webvr/webxr.html , and enabled dom.webxr.enabled. Is that all I need to do?

No, that's out of date. Clone https://github.com/manishearth/webgl-to-webvr and check out the xr branch

Yeah, you should just use servo master. Patch a new backend into https://github.com/servo/webxr/.

@jdm
Copy link
Member

@jdm jdm commented Jul 19, 2019

@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Jul 19, 2019

@paulrouget The main things are

a) Add a new backend to servo/webxr.

b) In the hololens library, register the Hololens back end.

For the GL context, I ended up sharing the context between both the immersive display and webrender, which worked fine but it might have been better to create two contexts that share textures.

I'm about to port magicleap from the old rust-webvr to the new shiny webxr API. I should have a better idea about how things shake out once I've done that. At the moment webxr just has the test backends (headless and glwindow).

@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Jul 19, 2019

Oh, and as part of the magicleap port, I'm making the necessary changes to libsimpleservo, which you may want for a libhlservo.

@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Jul 19, 2019

The WIP magicleap port... asajeffrey/webxr@6ff2fea

@jdm
Copy link
Member

@jdm jdm commented Jul 28, 2019

@jdm
Copy link
Member

@jdm jdm commented Jul 28, 2019

The panic occurs after these log messages have appeared:

GL ERROR: Invalid surface
BrowserPage::RecoverFromLostDevice()
BrowserPage:StopRenderLoop()
GL ERROR: Invalid surface
@jdm
Copy link
Member

@jdm jdm commented Jul 28, 2019

Those GL errors go away if I add MakeCurrentXR() inside BrowserPage::FlushXr() before the swap occurs, but the panic remains.

@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Jul 29, 2019

Hmm... That code has lots of GlWindow in it, which is the glwindow test device. Shouldn't there be some UWP code in there somewhere?

@jdm
Copy link
Member

@jdm jdm commented Jul 29, 2019

I believe the idea was to get the display working in a second ANGLE-based window in the app.

@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Jul 29, 2019

Not sure how that is going to get at, e.g., the pose information, device viewports, and all the rest of the stuff that's needed for immersive AR.

@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Jul 29, 2019

For now, I'm just trying to get the webxr content to render in another UWP Angle surface. Next is to use a shared texture between a offscreen GL buffer and D3D.

@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Jul 29, 2019

Those GL errors go away if I add MakeCurrentXR() inside BrowserPage::FlushXr() before the swap occurs, but the panic remains.

The way make_current and swap_buffer are called doesn't look right.

  1. make_current is called for XR
  2. make_current is called for WR
  3. swap_buffer is called for WR
  4. swap_buffer is called for XR
@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Jul 29, 2019

@asajeffrey I'm trying to reproduce what we do for the glutin port for now. The idea is that we have 2 surfaces, one with WR, one with XR.

@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Jul 29, 2019

@paulrouget Hmm, I suspect what's going on is that an rAF is beginning, but isn't ending promptly, so WR gets scheduled in between, I'm not sure what to do about this, perhaps move the call to make_current from requestAnimaionFrame to renderAnimationFrame?

@jdm
Copy link
Member

@jdm jdm commented Sep 19, 2019

We have a working immersive mode now.

@jdm jdm closed this Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.