Skip to content

Texture size attributes #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 15, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added support to XRProjectionLayer to return width/height/depth of it…
…s internal texture
  • Loading branch information
cabanier committed Jan 15, 2021
commit 769c0fe153df11a4ba48d464840f5ab0c8c0b129
19 changes: 17 additions & 2 deletions webxrlayers-1.bs
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,25 @@ Projection layers should be refreshed close to the device's native frame rate.

<pre class="idl">
[Exposed=Window] interface XRProjectionLayer : XRCompositionLayer {
readonly attribute unsigned long textureWidth;
readonly attribute unsigned long textureHeight;
readonly attribute unsigned long textureLayers;

readonly attribute boolean ignoreDepthValues;
};
</pre>

The <dfn attribute for="XRProjectionLayer">textureWidth</dfn> attribute returns the width in pixels of
the [=colorTextures=] textures of this layer.

The <dfn attribute for="XRProjectionLayer">textureHeight</dfn> attribute returns the height in pixels of
the [=colorTextures=] textures of this layer.

The <dfn attribute for="XRProjectionLayer">textureLayers</dfn> attribute returns the number of layers of
the [=colorTextures=] textures of this layer if the {{XRProjectionLayer}} was initialized with a
{{XRProjectionLayerInit/textureType}} of {{"texture-array"}}. Otherwise it will return <code>1</code>.


The <dfn attribute for="XRProjectionLayer">ignoreDepthValues</dfn> attribute, if <code>true</code>, indicates that the
[=XR Compositor=] MUST NOT make use of values in the depth buffer attachment when rendering. When the attribute
is <code>false</code> it indicates that the content of the depth buffer attachment will be used by the
Expand Down Expand Up @@ -1110,8 +1125,8 @@ To <dfn>allocate color textures for projection layers</dfn> using an {{XRProject
<dd> Return |array| and abort these steps.
</dl>
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.
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|.
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|.
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|.
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|.
1. return |array|.

</div>
Expand Down