Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions webxrlayers-1.bs
Original file line number Diff line number Diff line change
Expand Up @@ -874,12 +874,16 @@ If {{XRProjectionLayerInit/depthFormat}} is <code>0</code> the layer will not pr

This is the <dfn>list of depth formats for projection layers</dfn> that the [=XR Compositor=] MUST support:

For WebGL1 contexts with the '{{WEBGL_depth_texture}}' [=extension=] enabled or WebGL2 contexts:
For {{WebGLRenderingContext}} contexts with the '{{WEBGL_depth_texture}}' [=extension=] enabled or WebGL2 contexts:

- {{DEPTH_COMPONENT}}
- {{DEPTH_STENCIL}}

For WebGL2 contexts these additional formats are supported:
If the extension was not enabled, the request for a depth texture is ignored.

NOTE: this could be confusing to authors because they might expect a depth texture. If possible, provide a warning with the reason why the texture was not created.

For {{WebGL2RenderingContext}} contexts these additional formats are supported:

- {{DEPTH_COMPONENT24}}
- {{DEPTH24_STENCIL8}}
Expand Down Expand Up @@ -940,12 +944,12 @@ If {{XRLayerInit/depthFormat}} is not supplied, the layer will not provide a dep

This is the <dfn>list of depth formats for non-projection layers</dfn> that the [=XR Compositor=] MUST support:

For WebGL1 contexts with the '{{WEBGL_depth_texture}}' [=extension=] enabled or WebGL2 contexts:
For {{WebGLRenderingContext}} contexts with the '{{WEBGL_depth_texture}}' [=extension=] enabled or WebGL2 contexts:

- {{DEPTH_COMPONENT}}
- {{DEPTH_STENCIL}}

For WebGL2 contexts these additional formats are supported:
For {{WebGL2RenderingContext}} contexts these additional formats are supported:

- {{DEPTH_COMPONENT24}}
- {{DEPTH24_STENCIL8}}
Expand Down Expand Up @@ -1147,10 +1151,11 @@ To <dfn>allocate color textures for projection layers</dfn> using an {{XRProject
<div class="algorithm" data-algorithm="allocate depth textures for projection layers">

To <dfn>allocate depth textures for projection layers</dfn> using an {{XRProjectionLayer}} |layer|, an {{XRTextureType}} |textureType|, a {{GLenum}} |textureFormat| and a float |scaleFactor|, the user agent MUST run the following steps:
1. let |array| be a [=new=] array in the [=relevant realm=] of |context|.
1. let |context| be |layer|'s [=XRCompositionLayer/context=].
1. let |session| be |layer|'s [=XRCompositionLayer/session=].
1. Let |array| be a [=new=] array in the [=relevant realm=] of |context|.
1. Let |context| be |layer|'s [=XRCompositionLayer/context=].
1. Let |session| be |layer|'s [=XRCompositionLayer/session=].
1. If |textureFormat| is <code>0</code>, return |array| and abort these steps.
1. If |context| is a {{WebGLRenderingContext}} and the {{WEBGL_depth_texture}} [=extension=] is not enabled in |context|, return |array| and abort these steps.
1. If |textureFormat| is not in the [=list of depth formats for projection layers=], throw a {{NotSupportedError}} and abort these steps.
1. let |numViews| be the number of the |session|'s [=list of views=] excluding the [=secondary view|secondary views=].
1. Let |view| be the first entry in the |session|'s [=list of views=] that is not a [=secondary view=].
Expand Down Expand Up @@ -1206,6 +1211,7 @@ To <dfn>allocate the depth textures for the secondary views</dfn> using an {{XRP
1. Let |context| be |layer|'s [=XRCompositionLayer/context=].
1. Let |session| be |layer|'s [=XRCompositionLayer/session=].
1. If |textureFormat| is <code>0</code>, return |array| and abort these steps.
1. If |context| is a {{WebGLRenderingContext}} and the {{WEBGL_depth_texture}} [=extension=] is not enabled in |context|, return |array| and abort these steps.
1. If |textureFormat| is not in the [=list of depth formats for projection layers=], throw a {{NotSupportedError}} and abort these steps.
1. Let |array| be a [=new=] array in the [=relevant realm=] of |context|.
1. For each |view| in the |session|'s [=list of views=]:
Expand Down