immersive-web / layers

A feature repo for working on multi-layer support in WebXR. Feature leads: Rik Cabanier and Artem Bolgar (Oculus)
https://immersive-web.github.io/layers/
Other
90 stars 19 forks source link

Should XRRenderState layers be optional? #297

Open rgerd opened 2 years ago

rgerd commented 2 years ago

Reading the spec, I see the following:

11.1. XRRenderState changes This module extends the XRRenderStateInit and XRRenderState interfaces with a new optional array layers containing instances of XRLayer.

11.2. updateRenderState changes "If newState’s baseLayer is set ... Set session’s pending render state's layers to null."

But then the IDL for XRRenderState is specified with a non-optional layers array:

[SecureContext, Exposed=Window] partial interface XRRenderState {
  readonly attribute FrozenArray<XRLayer> layers;
};

Seems like the layers array should either be defined as optional or the algorithm should recommend clearing the layers array.

cabanier commented 2 years ago

Thanks for catching! the algorithm should clear the array, not set it to null