servo / webxr

Bindings for WebXR
Mozilla Public License 2.0
81 stars 24 forks source link

Remove main thread XR #120

Open asajeffrey opened 4 years ago

asajeffrey commented 4 years ago

If we can move most devices off the main thread, this just leaves glwindow on macos as being the only device with main thread affinity. We could refactor the code so that the main-thread code is in webxr/glwindow rather than webxr-api which would avoid the complexity on platforms which don't need it.

asajeffrey commented 4 years ago

IRC chat with @jdm on why this might be A Good Thing: https://mozilla.logbot.info/servo/20200114#c16853695

Manishearth commented 4 years ago

Oh, that's an interesting plan. So basically when we set up the discovery object we give it a handle to the main thread for the few cases where it needs one? That can work.

asajeffrey commented 4 years ago

I think we could just rip out all the main-thread-specific code, and for devices that have main thread affinity, they can do the messaging themselves. The downside would be one more active thread for devices which have main thread affinity, but if that's just the glwindow test device then I'm not too worried.