Add profiling for WebXR

This commit is contained in:
Manish Goregaokar 2020-02-19 17:23:39 -08:00
parent 52c9cce4c4
commit f3e1aba4e3
12 changed files with 93 additions and 9 deletions

View file

@ -2530,11 +2530,17 @@ impl Document {
return;
}
#[allow(unused)]
let mut time = 0;
#[cfg(feature = "xr-profile")]
{
time = time::precise_time_ns();
}
let (sender, receiver) = webgl::webgl_channel().unwrap();
self.window
.webgl_chan()
.expect("Where's the WebGL channel?")
.send(WebGLMsg::SwapBuffers(dirty_context_ids, sender))
.send(WebGLMsg::SwapBuffers(dirty_context_ids, sender, time))
.unwrap();
receiver.recv().unwrap();
}