Skip to content

Commit e07923f

Browse files
authored
Merge pull request #1088 from Manishearth/caching2
Allow caching various objects (take 2)
2 parents aea256f + deb6236 commit e07923f

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

index.bs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,13 @@ NOTE: The <a href="https://immersive-web.github.io/layers">WebXR layers module</
940940
When an {{XRSession}} |session| receives updated [=viewer=] state for timestamp |frameTime| from the [=XRSession/XR device=], it runs an <dfn>XR animation frame</dfn>, which MUST run the following steps regardless of if the [=list of animation frame callbacks=] is empty or not:
941941

942942
1. Let |now| be the [=current high resolution time=].
943-
1. Let |frame| be a [=new=] {{XRFrame}} with [=XRFrame/time=] |frameTime| and {{XRFrame/session}} |session| in the [=relevant realm=] of |session|.
943+
1. Initialize |frame| as follows:
944+
<dl class="switch">
945+
<dt>If |session| has previously run an [=XR animation frame=], the user agent MUST:</dt>
946+
<dd>Let |frame| be the same {{XRFrame}} object created by the earlier [=XR animation frame=]</dd>
947+
<dt>Otherwise:</dt>
948+
<dd>Let |frame| be a [=new=] {{XRFrame}} with [=XRFrame/time=] |frameTime| and {{XRFrame/session}} |session| in the [=relevant realm=] of |session|.</dd>
949+
</dl>
944950
1. If |session|'s [=pending render state=] is not <code>null</code>, [=apply the pending render state=].
945951
1. If [=check the layers state=] with |session|'s {{XRSession/renderState}} is <code>false</code>, abort these steps.
946952
1. If |session|'s [=XRSession/mode=] is {{XRSessionMode/"inline"}} and |session|'s {{XRSession/renderState}}'s [=XRRenderState/output canvas=] is <code>null</code>, abort these steps.
@@ -1959,7 +1965,13 @@ The <dfn method for="XRWebGLLayer">getViewport(|view|)</dfn> method, when invoke
19591965
1. If |frame|'s {{XRFrame/session}} is not equal to |layer|'s [=XRWebGLLayer/session=], throw an {{InvalidStateError}} and abort these steps.
19601966
1. If |frame|'s [=XRFrame/active=] boolean is <code>false</code>, throw an {{InvalidStateError}} and abort these steps.
19611967
1. Let |glViewport| be the [=WebGL viewport=] from the [=list of viewports=] associated with |view|.
1962-
1. Let |viewport| be a [=new=] {{XRViewport}} in the [=relevant realm=] of |layer|'s [=XRWebGLLayer/session=].
1968+
1. Initialize |viewport| as follows:
1969+
<dl class="switch">
1970+
<dt>If a |view| with the same underlying [=view=] has been passed to a getViewport() call previously, and |glViewport| has not changed since then, the user agent MUST:</dt>
1971+
<dd>Let |viewport| be the same {{XRViewport}} object returned by the earlier call to {{XRWebGLLayer/getViewport()}}</dd>
1972+
<dt>Otherwise:</dt>
1973+
<dd>Let |viewport| be a [=new=] {{XRViewport}} in the [=relevant realm=] of |layer|'s [=XRWebGLLayer/session=].</dd>
1974+
</dl>
19631975
1. Initialize |viewport|'s {{XRViewport/x}} to |glViewport|'s <code>x</code> component.
19641976
1. Initialize |viewport|'s {{XRViewport/y}} to |glViewport|'s <code>y</code> component.
19651977
1. Initialize |viewport|'s {{XRViewport/width}} to |glViewport|'s <code>width</code>.

0 commit comments

Comments
 (0)