diff --git a/webxrlayers-1.bs b/webxrlayers-1.bs
index 21d9274..f265951 100755
--- a/webxrlayers-1.bs
+++ b/webxrlayers-1.bs
@@ -627,20 +627,30 @@ The aspectRatio attribute controls th
+
0, throw a {{TypeError}} and abort these steps.
+ 1. If |centralAngle| is less than 0 or greater than 2π, throw a {{TypeError}} and abort these steps.
+ 1. If |aspectRatio| is less than or equal to 0, throw a {{TypeError}} and abort these steps.
+
+null |transform|, floats |radius|, |centralAngle|, and |aspectRatio|, and a boolean |isStatic|, the user agent MUST run the following steps:
+ 1. Initialize |layer|'s {{XRCylinderLayer/radius}} to |radius|.
+ 1. Initialize |layer|'s {{XRCylinderLayer/centralAngle}} to |centralAngle|.
+ 1. Initialize |layer|'s {{XRCylinderLayer/aspectRatio}} to |aspectRatio|.
+ 1. Let |layer|'s {{XRCylinderLayer/space}} be |space|.
1. Initialize |layer|'s {{XRCylinderLayer/transform}} as follows:
{ x: 0.0, y: 0.0, z: 0.0, w: 1.0 }.
zero or infinity are treated as an infinite sphere.
+The radius attribute is the non-negative radius in meters of the sphere. A value of zero is treated as an infinite sphere.
Setting {{XREquirectLayer/radius}} to a value less than 0 will set it to 0.
@@ -700,20 +710,27 @@ When setting the space on an equirect layer with {{XRSpace}} |
null |transform|, floats |radius|, |centralHorizontalAngle|, |upperVerticalAngle|, and |lowerVerticalAngle|, and a boolean |isStatic|, the user agent MUST run the following steps:
+ 1. Initialize |layer|'s {{XREquirectLayer/radius}} to |radius|.
+ 1. If |layer|'s {{XREquirectLayer/radius}} is less than 0, set it to 0.
+ 1. Initialize |layer|'s {{XREquirectLayer/centralHorizontalAngle}} to |centralHorizontalAngle|.
+ 1. If |layer|'s {{XREquirectLayer/centralHorizontalAngle}} is less than 0, set it to 0.
+ 1. If |layer|'s {{XREquirectLayer/centralHorizontalAngle}} is greater than 2π, set it to 2π.
+ 1. Initialize |layer|'s {{XREquirectLayer/upperVerticalAngle}} to |upperVerticalAngle|.
+ 1. If |layer|'s {{XREquirectLayer/upperVerticalAngle}} is less than -π/2, set it to -π/2.
+ 1. If |layer|'s {{XREquirectLayer/upperVerticalAngle}} is greater than π/2, set it to π/2.
+ 1. Initialize |layer|'s {{XREquirectLayer/lowerVerticalAngle}} to |lowerVerticalAngle|.
+ 1. If |layer|'s {{XREquirectLayer/lowerVerticalAngle}} is less than -π/2, set it to -π/2.
+ 1. If |layer|'s {{XREquirectLayer/lowerVerticalAngle}} is greater than π/2, set it to π/2.
+ 1. Let |layer|'s {{XREquirectLayer/space}} be |space|.
1. Initialize |layer|'s {{XREquirectLayer/transform}} as follows:
true, throw {{InvalidStateError}} and abort these steps.
1. If |context| is lost, throw {{InvalidStateError}} and abort these steps.
1. If |layout| is {{XRLayerLayout/"default"}}, throw {{TypeError}} and abort these steps.
+ 1. Run [=validate cylinder layer parameters=] with |init|'s {{XRCylinderLayerInit/radius}}, {{XRCylinderLayerInit/centralAngle}}, and {{XRCylinderLayerInit/aspectRatio}}.
1. Let |layer| be a [=new=] {{XRCylinderLayer}} in the [=relevant realm=] of [=this=].
1. Run [=initialize a composition layer=] on |layer| with |session| and |context|.
- 1. Run [=initialize a cylinder layer=] with |layer| and |init|.
+ 1. Run [=initialize a cylinder layer=] with |layer|, |init|'s {{XRLayerInit/space}}, {{XRCylinderLayerInit/transform}}, {{XRCylinderLayerInit/radius}}, {{XRCylinderLayerInit/centralAngle}}, {{XRCylinderLayerInit/aspectRatio}}, and {{XRLayerInit/isStatic}}.
1. let |layout| be the result of [=determine the layout attribute|determining the layout attribute=] with |init|'s {{XRLayerInit/textureType}}, |context| and |init|'s {{XRLayerInit/layout}}.
1. Initialize |layer|'s {{XRCompositionLayer/layout}} to |layout|.
1. Initialize |layer|'s {{XRCompositionLayer/needsRedraw}} to true.
@@ -1572,7 +1590,7 @@ When this method is invoked, the user agent MUST run the following steps:
1. If |init|'s {{XRLayerInit/space}} has a [=XRReferenceSpace/type=] of {{XRReferenceSpaceType/"viewer"}}, throw {{TypeError}} and abort these steps.
1. Let |layer| be a [=new=] {{XREquirectLayer}} in the [=relevant realm=] of [=this=].
1. Run [=initialize a composition layer=] on |layer| with |session| and |context|.
- 1. Run [=initialize a equirect layer=] with |layer| and |init|.
+ 1. Run [=initialize a equirect layer=] with |layer|, |init|'s {{XRLayerInit/space}}, {{XREquirectLayerInit/transform}}, {{XREquirectLayerInit/radius}}, {{XREquirectLayerInit/centralHorizontalAngle}}, {{XREquirectLayerInit/upperVerticalAngle}}, {{XREquirectLayerInit/lowerVerticalAngle}}, and {{XRLayerInit/isStatic}}.
1. let |layout| be the result of [=determine the layout attribute|determining the layout attribute=] with |init|'s {{XRLayerInit/textureType}}, |context| and |init|'s {{XRLayerInit/layout}}.
1. Initialize |layer|'s {{XRCompositionLayer/layout}} to |layout|.
1. Initialize |layer|'s {{XRCompositionLayer/needsRedraw}} to true.
@@ -2033,13 +2051,13 @@ When this method is invoked, the user agent MUST run the following steps:
1. If |session| was not created with "[=feature descriptor/layers=]" enabled, throw a {{NotSupportedError}} and abort these steps.
1. If |session|'s {{XRSession/ended}} value is true, throw {{InvalidStateError}} and abort these steps.
1. If |init|'s {{XRMediaLayerInit/layout}} is {{XRLayerLayout/"default"}}, throw a {{TypeError}} and abort these steps.
+ 1. Let |aspectRatio| be |init|'s {{XRMediaCylinderLayerInit/aspectRatio}} if the member is present and not null; otherwise, let |aspectRatio| be the result of [=calculate the aspect ratio=] with |video| and |init|'s {{XRMediaLayerInit/layout}}.
+ 1. Run [=validate cylinder layer parameters=] with |init|'s {{XRMediaCylinderLayerInit/radius}}, {{XRMediaCylinderLayerInit/centralAngle}}, and |aspectRatio|.
1. Let |layer| be a [=new=] {{XRCylinderLayer}} in the [=relevant realm=] of [=this=].
1. Run [=initialize a composition layer=] on |layer| with |session|.
1. Initialize |layer|'s [=XRCompositionLayer/media=] to |video|.
1. Initialize |layer|'s {{XRCompositionLayer/needsRedraw}} to false.
- 1. Let |aspectRatio| be the result of [=calculate the aspect ratio=] with |video| and |init|'s {{XRMediaLayerInit/layout}}.
- 1. If |init|'s {{XRMediaCylinderLayerInit/aspectRatio}} is undefined, set {{XRMediaCylinderLayerInit/aspectRatio}} to |aspectRatio|.
- 1. Run [=initialize a cylinder layer=] with |layer| and |init|.
+ 1. Run [=initialize a cylinder layer=] with |layer|, |init|'s {{XRMediaLayerInit/space}}, {{XRMediaCylinderLayerInit/transform}}, {{XRMediaCylinderLayerInit/radius}}, {{XRMediaCylinderLayerInit/centralAngle}}, |aspectRatio|, and false.
1. If the [=XR Compositor=] knows that it will be unable to create the resources for the |layer| for any reason, throw an {{OperationError}} and abort these steps.
1. return |layer|.
@@ -2054,13 +2072,13 @@ When this method is invoked, the user agent MUST run the following steps:
1. If |session| was not created with "[=feature descriptor/layers=]" enabled, throw a {{NotSupportedError}} and abort these steps.
1. If |session|'s {{XRSession/ended}} value is true, throw {{InvalidStateError}} and abort these steps.
1. If |init|'s {{XRMediaLayerInit/layout}} is {{XRLayerLayout/"default"}}, throw a {{TypeError}} and abort these steps.
- 1. If |init|'s {{XRLayerInit/space}} is not an instance of type {{XRReferenceSpace}}, throw {{InvalidStateError}} and abort these steps.
- 1. If |init|'s {{XRLayerInit/space}} has a [=XRReferenceSpace/type=] of {{XRReferenceSpaceType/"viewer"}}, throw {{InvalidStateError}} and abort these steps.
+ 1. If |init|'s {{XRMediaLayerInit/space}} is not an instance of type {{XRReferenceSpace}}, throw {{InvalidStateError}} and abort these steps.
+ 1. If |init|'s {{XRMediaLayerInit/space}} has a [=XRReferenceSpace/type=] of {{XRReferenceSpaceType/"viewer"}}, throw {{InvalidStateError}} and abort these steps.
1. Let |layer| be a [=new=] {{XREquirectLayer}} in the [=relevant realm=] of [=this=].
1. Run [=initialize a composition layer=] on |layer| with |session|.
1. Initialize |layer|'s [=XRCompositionLayer/media=] to |video|.
1. Initialize |layer|'s {{XRCompositionLayer/needsRedraw}} to false.
- 1. Run [=initialize a equirect layer=] with |layer| and |init|.
+ 1. Run [=initialize a equirect layer=] with |layer|, |init|'s {{XRMediaLayerInit/space}}, {{XRMediaEquirectLayerInit/transform}}, {{XRMediaEquirectLayerInit/radius}}, {{XRMediaEquirectLayerInit/centralHorizontalAngle}}, {{XRMediaEquirectLayerInit/upperVerticalAngle}}, {{XRMediaEquirectLayerInit/lowerVerticalAngle}}, and false.
1. If the [=XR Compositor=] knows that it will be unable to create the resources for the |layer| for any reason, throw an {{OperationError}} and abort these steps.
1. return |layer|.
@@ -2292,6 +2310,7 @@ New features:
Changes:
+- Define initialization validation for cylinder and equirect layers (GitHub #333)
- fixed small issue in layout algo and in clearing of opaque textures (GitHub #257)
- Clarify aspectratio (GitHub #256)
- Added some language about the layer memory allocation (GitHub #255)