Closed asajeffrey closed 5 years ago
An attempt at doing this... https://github.com/asajeffrey/rust-webvr/blob/glwindow/rust-webvr-api/src/vr_main_thread_heartbeat.rs.
This is also needed when rendering to a window on MacOS, which requires windows to live on the main thread. https://github.com/asajeffrey/rust-webvr/blob/glwindow/rust-webvr/src/api/glwindow/heartbeat.rs
Currently the API has no concept of the "main thread" of an application, and assumes that
VRServiceManager::new()
andVRServiceManager::register_defaults()
can be safely called from any thread (in servo, they're called from theWebVRThread
). This has a mismatch with devices (such as MagicLeap) which have a main thread, and where the APIs to access the device capabilities aren't thread-safe.