You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: webxrlayers-1.bs
+13-7Lines changed: 13 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -874,12 +874,16 @@ If {{XRProjectionLayerInit/depthFormat}} is <code>0</code> the layer will not pr
874
874
875
875
This is the <dfn>list of depth formats for projection layers</dfn> that the [=XR Compositor=] MUST support:
876
876
877
-
For WebGL1 contexts with the '{{WEBGL_depth_texture}}'[=extension=] enabled or WebGL2 contexts:
877
+
For {{WebGLRenderingContext}} contexts with the '{{WEBGL_depth_texture}}'[=extension=] enabled or WebGL2 contexts:
878
878
879
879
- {{DEPTH_COMPONENT}}
880
880
- {{DEPTH_STENCIL}}
881
881
882
-
For WebGL2 contexts these additional formats are supported:
882
+
If the extension was not enabled, the request for a depth texture is ignored.
883
+
884
+
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.
885
+
886
+
For {{WebGL2RenderingContext}} contexts these additional formats are supported:
883
887
884
888
- {{DEPTH_COMPONENT24}}
885
889
- {{DEPTH24_STENCIL8}}
@@ -940,12 +944,12 @@ If {{XRLayerInit/depthFormat}} is not supplied, the layer will not provide a dep
940
944
941
945
This is the <dfn>list of depth formats for non-projection layers</dfn> that the [=XR Compositor=] MUST support:
942
946
943
-
For WebGL1 contexts with the '{{WEBGL_depth_texture}}'[=extension=] enabled or WebGL2 contexts:
947
+
For {{WebGLRenderingContext}} contexts with the '{{WEBGL_depth_texture}}'[=extension=] enabled or WebGL2 contexts:
944
948
945
949
- {{DEPTH_COMPONENT}}
946
950
- {{DEPTH_STENCIL}}
947
951
948
-
For WebGL2 contexts these additional formats are supported:
952
+
For {{WebGL2RenderingContext}} contexts these additional formats are supported:
949
953
950
954
- {{DEPTH_COMPONENT24}}
951
955
- {{DEPTH24_STENCIL8}}
@@ -1147,10 +1151,11 @@ To <dfn>allocate color textures for projection layers</dfn> using an {{XRProject
1147
1151
<div class="algorithm" data-algorithm="allocate depth textures for projection layers">
1148
1152
1149
1153
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:
1150
-
1. let |array| be a [=new=] array in the [=relevant realm=] of |context|.
1151
-
1. let |context| be |layer|'s [=XRCompositionLayer/context=].
1152
-
1. let |session| be |layer|'s [=XRCompositionLayer/session=].
1154
+
1. Let |array| be a [=new=] array in the [=relevant realm=] of |context|.
1155
+
1. Let |context| be |layer|'s [=XRCompositionLayer/context=].
1156
+
1. Let |session| be |layer|'s [=XRCompositionLayer/session=].
1153
1157
1. If |textureFormat| is <code>0</code>, return |array| and abort these steps.
1158
+
1. If |context| is a {{WebGLRenderingContext}} and the {{WEBGL_depth_texture}}[=extension=] is not enabled in |context|, return |array| and abort these steps.
1154
1159
1. If |textureFormat| is not in the [=list of depth formats for projection layers=], throw a {{NotSupportedError}} and abort these steps.
1155
1160
1. let |numViews| be the number of the |session|'s [=list of views=] excluding the [=secondary view|secondary views=].
1156
1161
1. Let |view| be the first entry in the |session|'s [=list of views=] that is not a [=secondary view=].
@@ -1206,6 +1211,7 @@ To <dfn>allocate the depth textures for the secondary views</dfn> using an {{XRP
1206
1211
1. Let |context| be |layer|'s [=XRCompositionLayer/context=].
1207
1212
1. Let |session| be |layer|'s [=XRCompositionLayer/session=].
1208
1213
1. If |textureFormat| is <code>0</code>, return |array| and abort these steps.
1214
+
1. If |context| is a {{WebGLRenderingContext}} and the {{WEBGL_depth_texture}}[=extension=] is not enabled in |context|, return |array| and abort these steps.
1209
1215
1. If |textureFormat| is not in the [=list of depth formats for projection layers=], throw a {{NotSupportedError}} and abort these steps.
1210
1216
1. Let |array| be a [=new=] array in the [=relevant realm=] of |context|.
1211
1217
1. For each |view| in the |session|'s [=list of views=]:
0 commit comments