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
+12-1Lines changed: 12 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -855,7 +855,8 @@ The various layer types are created with the create____Layer series of methods o
855
855
such as whether or not to allocate a depth buffer or alpha channel, are passed in at layer creation time and will be immutable for the lifetime of the layer.
856
856
The method will return the associated XRCompositionLayer type.
857
857
858
-
Some layer types may not be supported by the {{XRSession}}. If a layer type isn't supported the method will throw an exception. {{XRProjectionLayer}} MUST be supported by all {{XRSession}}s.
858
+
If an {{XRSession}} was created with the "[=feature descriptor/layers=]" [=feature descriptor=], it MUST support all layer types.
859
+
If a layer type isn't supported its creation method MUST throw an exception. {{XRProjectionLayer}} MUST be supported by all {{XRSession}}s, whether it was created with the "[=feature descriptor/layers=]" [=feature descriptor=] or not.
859
860
</section>
860
861
861
862
Opaque textures {#xropaquetextures}
@@ -1229,19 +1230,22 @@ To <dfn>allocate color textures for projection layers</dfn> using an {{XRProject
1229
1230
<dt> If |textureType| is {{"texture-array"}}:
1230
1231
<dd> If the session’s [=view|views=] in the [=list of views=] don't all have the same [=recommended WebGL color texture resolution=] excluding the [=secondary view|secondary views=], throw a {{NotSupportedError}} and abort these steps.
1231
1232
<dd> Initialize |array| with 1 [=new=] instance of an [=opaque texture=] in the [=relevant realm=] of |context| created as a {{TEXTURE_2D_ARRAY}} texture with |numViews| layers using |context|, |textureFormat|, |width| and |height|.
1233
+
<dd> If the [=opaque texture=] was unable to be created for any reason, throw an {{OperationError}} and abort these steps.
1232
1234
<dd> Return |array| and abort these steps.
1233
1235
<dt> Otherwise
1234
1236
<dd> For each |view| in the |session|'s [=list of views=]:
1235
1237
1. If |view| is a [=secondary view=], continue.
1236
1238
1. Let |width| be the width of |view|'s [=recommended WebGL color texture resolution=] multiplied by |scaleFactor|.
1237
1239
1. Let |height| be the height of |view|'s [=recommended WebGL color texture resolution=] multiplied by |scaleFactor|.
1238
1240
1. let |texture| be a [=new=] instance of an [=opaque texture=] in the [=relevant realm=] of |context| created as a {{TEXTURE_2D}} texture with |context|, |textureFormat|, |width| and |height|.
1241
+
1. If the |texture| was unable to be created for any reason, throw an {{OperationError}} and abort these steps.
1239
1242
1. Append |texture| to |array|.
1240
1243
<dd> Return |array| and abort these steps.
1241
1244
</dl>
1242
1245
1. If the session’s [=view|views=] in the [=list of views=] don't all have the same [=recommended WebGL color texture resolution=] excluding the [=secondary view|secondary views=], throw a {{NotSupportedError}} and abort these steps.
1243
1246
1. If |layer|'s {{XRCompositionLayer/layout}} is {{XRLayerLayout/stereo-left-right}}, initialize |array| with 1 [=new=] instance of [=opaque texture=] in the [=relevant realm=] of |context| created as a |textureType| texture using |context| , |textureFormat|, |numViews| multiplied by |width| and |height|.
1244
1247
1. If |layer|'s {{XRCompositionLayer/layout}} is {{XRLayerLayout/stereo-top-bottom}}, initialize |array| with 1 [=new=] instance of [=opaque texture=] in the [=relevant realm=] of |context| created as a |textureType| texture using |context| , |textureFormat|, |width| and |numViews| multiplied by |height|.
1248
+
1. If the [=opaque texture=] was unable to be created for any reason, throw an {{OperationError}} and abort these steps.
1245
1249
1. return |array|.
1246
1250
1247
1251
</div>
@@ -1263,19 +1267,22 @@ To <dfn>allocate depth textures for projection layers</dfn> using an {{XRProject
1263
1267
<dl class="switch">
1264
1268
<dt> If |textureType| is {{"texture-array"}}:
1265
1269
<dd> Initialize |array| with 1 [=new=] instance of an [=opaque texture=] in the [=relevant realm=] of |context| created as a {{TEXTURE_2D_ARRAY}} texture with |numViews| layers using |context|, |textureFormat|, |stencil|, |width| and |height|.
1270
+
<dd> If the [=opaque texture=] was unable to be created for any reason, throw an {{OperationError}} and abort these steps.
1266
1271
<dd> Return |array| and abort these steps.
1267
1272
<dt> Otherwise
1268
1273
<dd> For each |view| in the |session|'s [=list of views=]:
1269
1274
1. If |view| is a [=secondary view=], continue.
1270
1275
1. Let |width| be the width of |view|'s [=recommended WebGL depth texture resolution=] multiplied by |scaleFactor|.
1271
1276
1. Let |height| be the height of |view|'s [=recommended WebGL depth texture resolution=] multiplied by |scaleFactor|.
1272
1277
1. let |texture| be a [=new=] instance of an [=opaque texture=] in the [=relevant realm=] of |context| created as a {{TEXTURE_2D}} texture with |context|, |textureFormat|, |stencil|, |width| and |height|.
1278
+
1. If the |texture| was unable to be created for any reason, throw an {{OperationError}} and abort these steps.
1273
1279
1. Append |texture| to |array|.
1274
1280
<dd> Return |array| and abort these steps.
1275
1281
</dl>
1276
1282
1. If the session’s [=view|views=] in the [=list of views=] don't all have the same [=recommended WebGL color texture resolution=] excluding the [=secondary view|secondary views=], throw a {{NotSupportedError}} and abort these steps.
1277
1283
1. If |layer|'s {{XRCompositionLayer/layout}} is {{XRLayerLayout/stereo-left-right}}, initialize |array| with 1 [=new=] instance of an [=opaque texture=] in the [=relevant realm=] of |context| created as a |textureType| texture using |context|, |textureFormat|, |stencil|, |numViews| multiplied by |width| and |height|.
1278
1284
1. If |layer|'s {{XRCompositionLayer/layout}} is {{XRLayerLayout/stereo-top-bottom}}, initialize |array| with 1 [=new=] instance of an [=opaque texture=] in the [=relevant realm=] of |context| created as a |textureType| texture using |context|, |textureFormat|, |stencil|, |width| and |numViews| multiplied by |height|.
1285
+
1. If the [=opaque texture=] was unable to be created for any reason, throw an {{OperationError}} and abort these steps.
1279
1286
1. return |array|.
1280
1287
1281
1288
</div>
@@ -1296,19 +1303,22 @@ To <dfn>allocate motion vector textures for projection layers</dfn> using an {{X
1296
1303
<dl class="switch">
1297
1304
<dt> If |textureType| is {{"texture-array"}}:
1298
1305
<dd> Initialize |array| with 1 [=new=] instance of an [=opaque texture=] in the [=relevant realm=] of |context| created as a {{TEXTURE_2D_ARRAY}} texture with |numViews| layers using |context|, {{RGBA16F}}, |width| and |height|.
1306
+
<dd> If the [=opaque texture=] was unable to be created for any reason, throw an {{OperationError}} and abort these steps.
1299
1307
<dd> Return |array| and abort these steps.
1300
1308
<dt> Otherwise
1301
1309
<dd> For each |view| in the |session|'s [=list of views=]:
1302
1310
1. If |view| is a [=secondary view=], continue.
1303
1311
1. Let |width| be the width of |view|'s [=recommended motion vector texture resolution=] multiplied by |scaleFactor|.
1304
1312
1. Let |height| be the height of |view|'s [=recommended motion vector texture resolution=] multiplied by |scaleFactor|.
1305
1313
1. let |texture| be a [=new=] instance of an [=opaque texture=] in the [=relevant realm=] of |context| created as a {{TEXTURE_2D}} texture with |context|, {{RGBA16F}}, |width| and |height|.
1314
+
1. If the |texture| was unable to be created for any reason, throw an {{OperationError}} and abort these steps.
1306
1315
1. Append |texture| to |array|.
1307
1316
<dd> Return |array| and abort these steps.
1308
1317
</dl>
1309
1318
1. If the session’s [=view|views=] in the [=list of views=] don't all have the same [=recommended motion vector texture resolution=] excluding the [=secondary view|secondary views=], throw a {{NotSupportedError}} and abort these steps.
1310
1319
1. If |layer|'s {{XRCompositionLayer/layout}} is {{XRLayerLayout/stereo-left-right}}, initialize |array| with 1 [=new=] instance of an [=opaque texture=] in the [=relevant realm=] of |context| created as a |textureType| texture using |context|, {{RGBA16F}}, |numViews| multiplied by |width| and |height|.
1311
1320
1. If |layer|'s {{XRCompositionLayer/layout}} is {{XRLayerLayout/stereo-top-bottom}}, initialize |array| with 1 [=new=] instance of an [=opaque texture=] in the [=relevant realm=] of |context| created as a |textureType| texture using |context|, {{RGBA16F}}, |width| and |numViews| multiplied by |height|.
1321
+
1. If the [=opaque texture=] was unable to be created for any reason, throw an {{OperationError}} and abort these steps.
1312
1322
1. return |array|.
1313
1323
1314
1324
</div>
@@ -1331,6 +1341,7 @@ To <dfn>allocate the color textures for the secondary views</dfn> using an {{XRP
1331
1341
<dt> Otherwise
1332
1342
<dd> Let |texture| be a [=new=] instance of an [=opaque texture=] in the [=relevant realm=] of |context| created as a {{TEXTURE_2D}} texture with |context|, |textureFormat|, |width| and |height|.
1333
1343
</dl>
1344
+
1. If the |texture| was unable to be created for any reason, throw an {{OperationError}} and abort these steps.
0 commit comments