diff --git a/Cargo.lock b/Cargo.lock index f187b5e116c..268d829cedb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5624,7 +5624,7 @@ dependencies = [ [[package]] name = "webxr" version = "0.0.1" -source = "git+https://github.com/servo/webxr#17dcfc9dfd3b8b29caebe7cf022c1855d68920f1" +source = "git+https://github.com/servo/webxr#ee763bc2c579c72c1b1a0706e2876b1f1ddff34d" dependencies = [ "bindgen 0.49.2 (registry+https://github.com/rust-lang/crates.io-index)", "euclid 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5633,6 +5633,7 @@ dependencies = [ "glutin 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "openxr 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)", "webxr-api 0.0.1 (git+https://github.com/servo/webxr)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "wio 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5641,7 +5642,7 @@ dependencies = [ [[package]] name = "webxr-api" version = "0.0.1" -source = "git+https://github.com/servo/webxr#17dcfc9dfd3b8b29caebe7cf022c1855d68920f1" +source = "git+https://github.com/servo/webxr#ee763bc2c579c72c1b1a0706e2876b1f1ddff34d" dependencies = [ "euclid 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", "gleam 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/components/script/dom/xrsession.rs b/components/script/dom/xrsession.rs index 3d4bbc7716b..dacfc373540 100644 --- a/components/script/dom/xrsession.rs +++ b/components/script/dom/xrsession.rs @@ -175,7 +175,7 @@ impl XRSession { } /// https://immersive-web.github.io/webxr/#xr-animation-frame - fn raf_callback(&self, (time, frame): (f64, Frame)) { + fn raf_callback(&self, (time, mut frame): (f64, Frame)) { // Step 1 if let Some(pending) = self.pending_render_state.take() { // https://immersive-web.github.io/webxr/#apply-the-pending-render-state @@ -200,6 +200,10 @@ impl XRSession { } } + for event in frame.events.drain(..) { + self.session.borrow_mut().apply_event(event) + } + // Step 2 let base_layer = match self.active_render_state.get().GetBaseLayer() { Some(layer) => layer, @@ -279,6 +283,12 @@ impl XRSessionMethods for XRSession { if let Some(ref layer) = init.baseLayer { pending.set_layer(Some(&layer)) } + + if init.depthFar.is_some() || init.depthNear.is_some() { + self.session + .borrow_mut() + .update_clip_planes(*pending.DepthNear() as f32, *pending.DepthFar() as f32); + } // XXXManishearth handle inlineVerticalFieldOfView Ok(()) }