WebXR layers spec adds support for Composition layers in WebXR. Composition layers have many benefits:
- Improved Performance and judder.
- Better Legibility/visual fidelity for elements such as text, UI, video, quads, cubemaps.
- Reduced Latency and power consumption
WebXR Layers, specifically XRProjectionLayer, will also enable a better render path for our gecko WebXR implementation. We need it to be competitive on WebXR performance and quality:
- Proper way to implement WebXR msaa. We disabled msaa in the current WebXR implementation because the OpaqueFBO approach exposed in WebXR API is not totally compatible with the path forward from the WebGL team. This is causing Firefox to have worse VR quality than other browsers. We need the XRProjectionLayer render path to enable msaa for the users.
- Proper way to enable multiview. Multiview is already exposed in WebGL but it requires several copies and conversions from textures to side-by-side FBO in the render path to be connected to WebXR. By using the texture-arrays approach provided in the XRProjectionLayer we can implement multiview ideally using a render path with 0 blits. This will help to improve the WebXR performance, especially on projects such as Hubs.
Platform coverage: Android initially behind a pref. Desktop later. Most of the code is multi platform though.
- Oculus Browser (based on Chrome) has already shipped it behind a pref
- Servo: https://github.com/servo/servo/issues/27468
Is this feature enabled by default in sandboxed iframes?
The same as WebXR, it will not be enabled by default in sandboxed iframes
Layers WPT will be added to: https://github.com/web-platform-tests/wpt/tree/master/webxr
Link to standards-positions discussion: