Skip to content

Commit 2731a1c

Browse files
authored
Merge pull request #241 from cabanier/texture-size-attributes
Texture size attributes
2 parents bab6191 + 769c0fe commit 2731a1c

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

webxrlayers-1.bs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,25 @@ Projection layers should be refreshed close to the device's native frame rate.
440440

441441
<pre class="idl">
442442
[Exposed=Window] interface XRProjectionLayer : XRCompositionLayer {
443+
readonly attribute unsigned long textureWidth;
444+
readonly attribute unsigned long textureHeight;
445+
readonly attribute unsigned long textureLayers;
446+
443447
readonly attribute boolean ignoreDepthValues;
444448
};
445449
</pre>
446450

451+
The <dfn attribute for="XRProjectionLayer">textureWidth</dfn> attribute returns the width in pixels of
452+
the [=colorTextures=] textures of this layer.
453+
454+
The <dfn attribute for="XRProjectionLayer">textureHeight</dfn> attribute returns the height in pixels of
455+
the [=colorTextures=] textures of this layer.
456+
457+
The <dfn attribute for="XRProjectionLayer">textureLayers</dfn> attribute returns the number of layers of
458+
the [=colorTextures=] textures of this layer if the {{XRProjectionLayer}} was initialized with a
459+
{{XRProjectionLayerInit/textureType}} of {{"texture-array"}}. Otherwise it will return <code>1</code>.
460+
461+
447462
The <dfn attribute for="XRProjectionLayer">ignoreDepthValues</dfn> attribute, if <code>true</code>, indicates that the
448463
[=XR Compositor=] MUST NOT make use of values in the depth buffer attachment when rendering. When the attribute
449464
is <code>false</code> it indicates that the content of the depth buffer attachment will be used by the
@@ -1110,8 +1125,8 @@ To <dfn>allocate color textures for projection layers</dfn> using an {{XRProject
11101125
<dd> Return |array| and abort these steps.
11111126
</dl>
11121127
1. If the session’s [=view|views=] in the [=list of views=] don't all have the same [=recommended WebGL texture resolution=] excluding the [=secondary view|secondary views=], throw a {{NotSupportedError}} and abort these steps.
1113-
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|.
1114-
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|.
1128+
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|.
1129+
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|.
11151130
1. return |array|.
11161131

11171132
</div>

0 commit comments

Comments
 (0)