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
+31-28Lines changed: 31 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -1455,9 +1455,9 @@ When this method is invoked, the user agent MUST run the following steps:
1455
1455
1. Let |layer|'s [=depthStencilTextures=] be a [=new=] array in the [=relevant realm=] of this {{XRCubeLayer}}.
1456
1456
1. If |init|'s {{XRLayerInit/depthFormat}} is set, initialize |layer|'s [=depthStencilTextures=] as follows:
1457
1457
<dl class="switch">
1458
-
<dt> If |context| is not a {{WebGL2RenderingContext}} and the {{WEBGL_depth_texture}}[=extension=] is not enabled in |context|.
1458
+
<dt> If |context| is not a {{WebGL2RenderingContext}} and the {{WEBGL_depth_texture}}[=extension=] is not enabled in |context|
1459
1459
<dd> Throw {{TypeError}} and abort these steps.
1460
-
<dt> Else if |layout| is {{XRLayerLayout/"mono"}}:
1460
+
<dt> Else if |layout| is {{XRLayerLayout/"mono"}}
1461
1461
<dd> Initialize [=depthStencilTextures=] with 1 [=new=] instance of an [=opaque texture=] in the [=relevant realm=] of this {{XRCubeLayer}} created as a {{TEXTURE_CUBE_MAP}} texture with |context| and |init|'s {{XRLayerInit/depthFormat}}, {{XRLayerInit/viewPixelWidth}} and {{XRLayerInit/viewPixelHeight}} values.
1462
1462
<dt> Otherwise
1463
1463
<dd> Initialize [=depthStencilTextures=] with 2 [=new=] instances of an [=opaque texture=] in the [=relevant realm=] of this {{XRCubeLayer}} created as a {{TEXTURE_CUBE_MAP}} texture with |context| and |init|'s {{XRLayerInit/depthFormat}}, {{XRLayerInit/viewPixelWidth}} and {{XRLayerInit/viewPixelHeight}} values.
@@ -1498,10 +1498,10 @@ To <dfn>initialize the viewport</dfn> of an {{XRViewport}} |viewport| with a [=o
1498
1498
1. Set |viewport|'s {{XRViewport/height}} to the pixelh eight of |texture|.
1499
1499
1. Update |viewport| as follows:
1500
1500
<dl class="switch">
1501
-
<dt class="switch">If |layout| is {{XRLayerLayout/"stereo-left-right"}}:
1501
+
<dt class="switch">If |layout| is {{XRLayerLayout/"stereo-left-right"}}
1502
1502
<dd> Set |viewport|'s {{XRViewport/x}} to the pixel width of |texture| multiplied by |offset| and divided by |num|.
1503
1503
<dd> Set |viewport|'s {{XRViewport/width}} to the pixel width of |subimage|'s |texture| divided by |num|.
1504
-
<dt class="switch">Else if |layout| is {{XRLayerLayout/"stereo-top-bottom"}}:
1504
+
<dt class="switch">Else if |layout| is {{XRLayerLayout/"stereo-top-bottom"}}
1505
1505
<dd> Set |viewport|'s {{XRViewport/y}} to the pixel height of |texture| multiplied by |offset| and divided by |num|.
1506
1506
<dd> Set |viewport|'s {{XRViewport/height}} to the pixel height of |subimage|'s |texture| divided by |num|.
1507
1507
</dl>
@@ -1515,7 +1515,7 @@ When this method is invoked on an {{XRWebGLBinding}} |binding|, it MUST run the
1515
1515
1516
1516
1. Initialize |subimage| as follows:
1517
1517
<dl class="switch">
1518
-
<dt> If {{XRWebGLBinding/getSubImage()}} was called previously with the same |binding|, |layer| and |eye|, the user agent MAY:
1518
+
<dt> If {{XRWebGLBinding/getSubImage()}} was called previously with the same |binding|, |layer| and |eye|, the user agent MAY
1519
1519
<dd> Let |subimage| be the same {{XRWebGLSubImage}} object as returned by an earlier call with the same arguments.
1520
1520
<dt> Otherwise
1521
1521
<dd> Let |subimage| be a [=new=]{{XRWebGLSubImage}} in the [=relevant realm=] of [=this=].
@@ -1528,31 +1528,36 @@ When this method is invoked on an {{XRWebGLBinding}} |binding|, it MUST run the
1528
1528
1. If |eye| is {{XREye/"none"}}, throw a {{TypeError}} and abort these steps.
1529
1529
1. If |eye| is {{XREye/"right"}}, set |index| to <code>1</code>.
1530
1530
1. If [=validate the state of the XRWebGLSubImage creation function=] with |layer| and |frame| is <code>false</code>, throw an {{InvalidStateError}} and abort these steps.
1531
-
1. Initialize |subimage|'s {{XRWebGLSubImage/colorTexture}} as follows:
1531
+
1. Initialize |subimage|'s {{XRWebGLSubImage/imageIndex}} as follows:
1532
1532
<dl class="switch">
1533
1533
<dt class="switch">If the |layer| was created with a textureType of {{"texture-array"}}
1534
-
<dd> Initialize |subimage|'s {{XRWebGLSubImage/colorTexture}} with the first element of the |layer|'s [=colorTextures=] array.
1535
1534
<dd> Initialize |subimage|'s {{XRWebGLSubImage/imageIndex}} with |index|.
1536
1535
<dt> Otherwise
1536
+
<dd> Initialize |subimage|'s {{XRWebGLSubImage/imageIndex}} with <code>0</code>.
1537
+
</dl>
1538
+
</dl>
1539
+
1. Initialize |subimage|'s {{XRWebGLSubImage/colorTexture}} as follows:
1540
+
<dl class="switch">
1541
+
<dt class="switch">If the |layer| was created with a textureType of {{"texture"}}
1537
1542
<dd> Initialize |subimage|'s {{XRWebGLSubImage/colorTexture}} with the element at offset |index| of the |layer|'s [=colorTextures=] array.
1543
+
<dt> Otherwise
1544
+
<dd> Initialize |subimage|'s {{XRWebGLSubImage/colorTexture}} with the first element of the |layer|'s [=colorTextures=] array.
1538
1545
</dl>
1539
1546
</dl>
1540
1547
1. Initialize |subimage|'s {{XRWebGLSubImage/depthStencilTexture}} as follows:
1541
1548
<dl class="switch">
1542
-
<dt class="switch">If the |layer|'s [=depthStencilTextures=] is an empty array.
1543
-
<dd> Continue to the next entry.
1544
-
<dt> Else if the |layer| was created with a textureType of {{"texture-array"}}
1545
-
<dd> Initialize |subimage|'s {{XRWebGLSubImage/depthStencilTexture}} with the first element of |layer|'s [=depthStencilTextures=] array.
1546
-
<dt> Otherwise
1549
+
<dt class="switch">If the |layer|'s [=depthStencilTextures=] is an empty array
1550
+
<dd> Initialize |subimage|'s {{XRWebGLSubImage/depthStencilTexture}} with <code>null</code>.
1551
+
<dt> Else the |layer| was created with a textureType of {{"texture"}}
1547
1552
<dd> Initialize |subimage|'s {{XRWebGLSubImage/depthStencilTexture}} with the element at offset |index| of the |layer|'s [=depthStencilTextures=] array.
1553
+
<dt> Otherwise
1554
+
<dd> Initialize |subimage|'s {{XRWebGLSubImage/depthStencilTexture}} with the first element of |layer|'s [=depthStencilTextures=] array.
1548
1555
</dl>
1549
1556
1. Set |subimage|'s {{XRWebGLSubImage/textureWidth}} to the pixel width of |subimage|'s {{XRWebGLSubImage/colorTexture}}.
1550
1557
1. Set |subimage|'s {{XRWebGLSubImage/textureHeight}} to the pixel height of |subimage|'s {{XRWebGLSubImage/colorTexture}}.
1551
-
1. Let |index| be <code>0</code>.
1552
-
1. If |eye| is {{XREye/"right"}}, set |index| to <code>1</code>.
1553
-
1. Let |num| be <code>1</code>.
1554
-
1. If |eye| is not {{XREye/"none"}} and |layer|'s {{XRCompositionLayer/layout}} attribute is {{XRLayerLayout/"stereo-left-right"}} or {{XRLayerLayout/"stereo-top-bottom"}}, set |num| to <code>2</code>.
1555
-
1. Run [=initialize the viewport=] on |subimage|'s {{XRSubImage/viewport}} with |subimage|'s {{XRWebGLSubImage/colorTexture}}, |layer|'s {{XRCompositionLayer/layout}}, |index| and |num|.
1558
+
1. Let |viewsPerTexture| be <code>1</code>.
1559
+
1. If |layer|'s {{XRCompositionLayer/layout}} attribute is {{XRLayerLayout/"stereo-left-right"}} or {{XRLayerLayout/"stereo-top-bottom"}}, set |viewsPerTexture| to <code>2</code>.
1560
+
1. Run [=initialize the viewport=] on |subimage|'s {{XRSubImage/viewport}} with |subimage|'s {{XRWebGLSubImage/colorTexture}}, |layer|'s {{XRCompositionLayer/layout}}, |index| and |viewsPerTexture|.
1556
1561
1. [=Queue a task=] to set {{XRCompositionLayer/needsRedraw}} to <code>false</code>.
1557
1562
1. return |subimage|.
1558
1563
@@ -1565,7 +1570,7 @@ When this method is invoked on an {{XRWebGLBinding}} |binding|, it MUST run the
1565
1570
1566
1571
1. Initialize |subimage| as follows:
1567
1572
<dl class="switch">
1568
-
<dt> If {{XRWebGLBinding/getViewSubImage()}} was called previously with the same |binding|, |layer| and |view|, the user agent MAY:
1573
+
<dt> If {{XRWebGLBinding/getViewSubImage()}} was called previously with the same |binding|, |layer| and |view|, the user agent MAY
1569
1574
<dd> Let |subimage| be the same {{XRWebGLSubImage}} object as returned by an earlier call with the same arguments.
1570
1575
<dt> Otherwise
1571
1576
<dd> Let |subimage| be a [=new=]{{XRWebGLSubImage}} in the [=relevant realm=] of [=this=].
@@ -1582,34 +1587,32 @@ When this method is invoked on an {{XRWebGLBinding}} |binding|, it MUST run the
1582
1587
<dt> Otherwise
1583
1588
<dd> Let |index| be the offset of |view|'s [=view=] in |session|'s [=list of views=] excluding the [=secondary view|secondary views=].
1584
1589
</dl>
1585
-
1. Let |layout| be |layer|'s {{XRCompositionLayer/layout}}.
1586
-
1. Initialize |subimage|'s {{XRWebGLSubImage/imageIndex}} with <code>0</code>.
1587
1590
1. Initialize |subimage|'s {{XRWebGLSubImage/imageIndex}} as follows:
1588
1591
<dl class="switch">
1589
1592
<dt> If the |layer| was created with a textureType of {{"texture-array"}}:
1590
1593
<dd> Initialize |subimage|'s {{XRWebGLSubImage/imageIndex}} with |index|.
1. Initialize |subimage|'s {{XRWebGLSubImage/colorTexture}} as follows:
1595
1598
<dl class="switch">
1596
1599
<dt> If |view| is a [=secondary view=] from |session|'s [=list of views=]
1597
1600
<dd> Initialize |subimage|'s {{XRWebGLSubImage/colorTexture}} with the element at offset |index| of the |layer|'s [=XRProjectionLayer/colorTextures for secondary views=].
1598
-
<dt> Else if the |layer| was created with a textureType of {{"texture-array"}} or if |layout| is {{XRLayerLayout/"stereo-left-right"}} or {{XRLayerLayout/"stereo-top-bottom"}}
1599
-
<dd> Initialize |subimage|'s {{XRWebGLSubImage/colorTexture}} with the first element of the |layer|'s [=colorTextures=] array.
1600
-
<dt> Otherwise
1601
+
<dt> Else if the |layer|'s {{XRCompositionLayer/layout}} is {{XRLayerLayout/"default"}} and the |layer| was created with a textureType of {{"texture"}}
1601
1602
<dd> Initialize |subimage|'s {{XRWebGLSubImage/colorTexture}} with the element at offset |index| of the |layer|'s [=colorTextures=] array.
1603
+
<dt> Otherwise
1604
+
<dd> Initialize |subimage|'s {{XRWebGLSubImage/colorTexture}} with the first element of the |layer|'s [=colorTextures=] array.
1602
1605
</dl>
1603
1606
1. Initialize |subimage|'s {{XRWebGLSubImage/depthStencilTexture}} as follows:
1604
1607
<dl class="switch">
1605
-
<dt> If the |layer|'s [=depthStencilTextures=] is an empty array.
1608
+
<dt> If the |layer|'s [=depthStencilTextures=] is an empty array
1606
1609
<dd> Initialize |subimage|'s {{XRWebGLSubImage/depthStencilTexture}} with <code>null</code>.
1607
1610
<dt> Else if |view| is a [=secondary view=] from |session|'s [=list of views=]
1608
1611
<dd> Initialize |subimage|'s {{XRWebGLSubImage/colorTexture}} with the element at offset |index| of the |layer|'s [=XRProjectionLayer/depthStencilTextures for secondary views=].
1609
-
<dt> Else if the |layer| was created with a textureType of {{"texture-array"}} or if |layout| is {{XRLayerLayout/"stereo-left-right"}} or {{XRLayerLayout/"stereo-top-bottom"}}
1610
-
<dd> Initialize |subimage|'s {{XRWebGLSubImage/depthStencilTexture}} with the first element of |layer|'s [=depthStencilTextures=] array.
1611
-
<dt> Otherwise
1612
+
<dt> Else if the |layer|'s {{XRCompositionLayer/layout}} is {{XRLayerLayout/"default"}} and the |layer| was created with a textureType of {{"texture"}}
1612
1613
<dd> Initialize |subimage|'s {{XRWebGLSubImage/depthStencilTexture}} with the element at offset |index| of the |layer|'s [=depthStencilTextures=] array.
1614
+
<dt> Otherwise
1615
+
<dd> Initialize |subimage|'s {{XRWebGLSubImage/depthStencilTexture}} with the first element of |layer|'s [=depthStencilTextures=] array.
1613
1616
</dl>
1614
1617
1. Set |subimage|'s {{XRWebGLSubImage/textureWidth}} to the pixel width of |subimage|'s {{XRWebGLSubImage/colorTexture}}.
1615
1618
1. Set |subimage|'s {{XRWebGLSubImage/textureHeight}} to the pixel height of |subimage|'s {{XRWebGLSubImage/colorTexture}}.
0 commit comments