Skip to content

Commit 7d07673

Browse files
authored
Merge pull request #60 from immersive-web/main
Update with main repo
2 parents 3450b00 + bd830d0 commit 7d07673

File tree

1 file changed

+31
-28
lines changed

1 file changed

+31
-28
lines changed

‎webxrlayers-1.bs‎

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,9 +1455,9 @@ When this method is invoked, the user agent MUST run the following steps:
14551455
1. Let |layer|'s [=depthStencilTextures=] be a [=new=] array in the [=relevant realm=] of this {{XRCubeLayer}}.
14561456
1. If |init|'s {{XRLayerInit/depthFormat}} is set, initialize |layer|'s [=depthStencilTextures=] as follows:
14571457
<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|
14591459
<dd> Throw {{TypeError}} and abort these steps.
1460-
<dt> Else if |layout| is {{XRLayerLayout/"mono"}}:
1460+
<dt> Else if |layout| is {{XRLayerLayout/"mono"}}
14611461
<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.
14621462
<dt> Otherwise
14631463
<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
14981498
1. Set |viewport|'s {{XRViewport/height}} to the pixelh eight of |texture|.
14991499
1. Update |viewport| as follows:
15001500
<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"}}
15021502
<dd> Set |viewport|'s {{XRViewport/x}} to the pixel width of |texture| multiplied by |offset| and divided by |num|.
15031503
<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"}}
15051505
<dd> Set |viewport|'s {{XRViewport/y}} to the pixel height of |texture| multiplied by |offset| and divided by |num|.
15061506
<dd> Set |viewport|'s {{XRViewport/height}} to the pixel height of |subimage|'s |texture| divided by |num|.
15071507
</dl>
@@ -1515,7 +1515,7 @@ When this method is invoked on an {{XRWebGLBinding}} |binding|, it MUST run the
15151515

15161516
1. Initialize |subimage| as follows:
15171517
<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
15191519
<dd> Let |subimage| be the same {{XRWebGLSubImage}} object as returned by an earlier call with the same arguments.
15201520
<dt> Otherwise
15211521
<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
15281528
1. If |eye| is {{XREye/"none"}}, throw a {{TypeError}} and abort these steps.
15291529
1. If |eye| is {{XREye/"right"}}, set |index| to <code>1</code>.
15301530
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:
15321532
<dl class="switch">
15331533
<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.
15351534
<dd> Initialize |subimage|'s {{XRWebGLSubImage/imageIndex}} with |index|.
15361535
<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"}}
15371542
<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.
15381545
</dl>
15391546
</dl>
15401547
1. Initialize |subimage|'s {{XRWebGLSubImage/depthStencilTexture}} as follows:
15411548
<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"}}
15471552
<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.
15481555
</dl>
15491556
1. Set |subimage|'s {{XRWebGLSubImage/textureWidth}} to the pixel width of |subimage|'s {{XRWebGLSubImage/colorTexture}}.
15501557
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|.
15561561
1. [=Queue a task=] to set {{XRCompositionLayer/needsRedraw}} to <code>false</code>.
15571562
1. return |subimage|.
15581563

@@ -1565,7 +1570,7 @@ When this method is invoked on an {{XRWebGLBinding}} |binding|, it MUST run the
15651570

15661571
1. Initialize |subimage| as follows:
15671572
<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
15691574
<dd> Let |subimage| be the same {{XRWebGLSubImage}} object as returned by an earlier call with the same arguments.
15701575
<dt> Otherwise
15711576
<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
15821587
<dt> Otherwise
15831588
<dd> Let |index| be the offset of |view|'s [=view=] in |session|'s [=list of views=] excluding the [=secondary view|secondary views=].
15841589
</dl>
1585-
1. Let |layout| be |layer|'s {{XRCompositionLayer/layout}}.
1586-
1. Initialize |subimage|'s {{XRWebGLSubImage/imageIndex}} with <code>0</code>.
15871590
1. Initialize |subimage|'s {{XRWebGLSubImage/imageIndex}} as follows:
15881591
<dl class="switch">
15891592
<dt> If the |layer| was created with a textureType of {{"texture-array"}}:
15901593
<dd> Initialize |subimage|'s {{XRWebGLSubImage/imageIndex}} with |index|.
15911594
<dt> Otherwise
1592-
<dd> Initialize |subimage|'s {{XRWebGLSubImage/imageIndex}} with <code>0</code>.
1595+
<dd> Initialize |subimage|'s {{XRWebGLSubImage/imageIndex}} to <code>0</code>.
15931596
</dl>
15941597
1. Initialize |subimage|'s {{XRWebGLSubImage/colorTexture}} as follows:
15951598
<dl class="switch">
15961599
<dt> If |view| is a [=secondary view=] from |session|'s [=list of views=]
15971600
<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"}}
16011602
<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.
16021605
</dl>
16031606
1. Initialize |subimage|'s {{XRWebGLSubImage/depthStencilTexture}} as follows:
16041607
<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
16061609
<dd> Initialize |subimage|'s {{XRWebGLSubImage/depthStencilTexture}} with <code>null</code>.
16071610
<dt> Else if |view| is a [=secondary view=] from |session|'s [=list of views=]
16081611
<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"}}
16121613
<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.
16131616
</dl>
16141617
1. Set |subimage|'s {{XRWebGLSubImage/textureWidth}} to the pixel width of |subimage|'s {{XRWebGLSubImage/colorTexture}}.
16151618
1. Set |subimage|'s {{XRWebGLSubImage/textureHeight}} to the pixel height of |subimage|'s {{XRWebGLSubImage/colorTexture}}.

0 commit comments

Comments
 (0)