Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion webxrlayers-1.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2154,6 +2154,7 @@ This module replaces the steps given by "[=/update the pending layers state=]" f
1. Set |session|'s [=pending render state=]'s {{XRRenderState/layers}} to <code>null</code>.
1. If |newState|'s {{XRRenderStateInit/layers}} is set:
1. If |session| was not created with "[=feature descriptor/layers=]" enabled and |newState|'s {{XRRenderStateInit/layers}} contains more than <code>1</code> instance, throw a {{NotSupportedError}} and abort these steps.
1. If |newState|'s {{XRRenderState/layers}} contains more than {{XRSession/maxRenderLayers}} entries, throw a {{NotSupportedError}} and abort these steps.
1. If |session|'s [=pending render state=] is <code>null</code>, set it to a copy of |activeState|.
1. If |newState|'s {{XRRenderStateInit/layers}} contains duplicate instances, throw a {{TypeError}} and abort these steps.
1. For each |layer| in |newState|'s {{XRRenderStateInit/layers}}:
Expand Down Expand Up @@ -2205,7 +2206,17 @@ with {{XRSession/renderState}} |state|, the user agent MUST run the following st

XRSession changes {#xrsessionchanges}
-----------------
This module adds the following to the [=XRSession interface=]:
This module extends and adds the following to the [=XRSession interface=]:

<pre class="idl">
[SecureContext, Exposed=Window] partial interface XRSession {
readonly attribute unsigned long maxRenderLayers;
};
</pre>

The <dfn attribute for="XRSession">maxRenderLayers</dfn> represents the maximum number of layers that the compositor MUST handle, and thus the maximum size of any {{XRRenderStateInit}}'s {{XRRenderStateInit/layers}} array. It SHOULD be possible to create more than this number of layers at a given time.

NOTE: This guidance is not intended to provide a limit on the number of layers allocatable by the user agent, as described in [[#xrlayerallocation|Allocation of layers]]. User Agents may allow e.g. for 20 layers to be created, while only allowing 10 at a time to be set via {{XRSession/updateRenderState()}}. It is also worth noting that because different layers may require a different amount of backend power or objects, user agents have some discretion in setting the `maxRenderLayers` value to ensure that at least that many layers can be rendered. However, user agents still need to reject whenever more layers are passed in, and cannot reject when less are passed in to updateRenderState.

Each {{XRSession}} has an internal [=WeakSet=] <dfn dfn-for="XRSession">bindings</dfn> that holds weak references to each {{XRWebGLBinding}} that was created with that session.

Expand Down