Skip to content

Allow caching various objects (take 2) #1088

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
Jun 26, 2020
Merged
Changes from all commits
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
16 changes: 14 additions & 2 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,13 @@ NOTE: The <a href="https://immersive-web.github.io/layers">WebXR layers module</
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:

1. Let |now| be the [=current high resolution time=].
1. Let |frame| be a [=new=] {{XRFrame}} with [=XRFrame/time=] |frameTime| and {{XRFrame/session}} |session| in the [=relevant realm=] of |session|.
1. Initialize |frame| as follows:
<dl class="switch">
<dt>If |session| has previously run an [=XR animation frame=], the user agent MUST:</dt>
<dd>Let |frame| be the same {{XRFrame}} object created by the earlier [=XR animation frame=]</dd>
<dt>Otherwise:</dt>
<dd>Let |frame| be a [=new=] {{XRFrame}} with [=XRFrame/time=] |frameTime| and {{XRFrame/session}} |session| in the [=relevant realm=] of |session|.</dd>
</dl>
1. If |session|'s [=pending render state=] is not <code>null</code>, [=apply the pending render state=].
1. If [=check the layers state=] with |session|'s {{XRSession/renderState}} is <code>false</code>, abort these steps.
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.
Expand Down Expand Up @@ -1959,7 +1965,13 @@ The <dfn method for="XRWebGLLayer">getViewport(|view|)</dfn> method, when invoke
1. If |frame|'s {{XRFrame/session}} is not equal to |layer|'s [=XRWebGLLayer/session=], throw an {{InvalidStateError}} and abort these steps.
1. If |frame|'s [=XRFrame/active=] boolean is <code>false</code>, throw an {{InvalidStateError}} and abort these steps.
1. Let |glViewport| be the [=WebGL viewport=] from the [=list of viewports=] associated with |view|.
1. Let |viewport| be a [=new=] {{XRViewport}} in the [=relevant realm=] of |layer|'s [=XRWebGLLayer/session=].
1. Initialize |viewport| as follows:
<dl class="switch">
<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>
<dd>Let |viewport| be the same {{XRViewport}} object returned by the earlier call to {{XRWebGLLayer/getViewport()}}</dd>
<dt>Otherwise:</dt>
<dd>Let |viewport| be a [=new=] {{XRViewport}} in the [=relevant realm=] of |layer|'s [=XRWebGLLayer/session=].</dd>
</dl>
1. Initialize |viewport|'s {{XRViewport/x}} to |glViewport|'s <code>x</code> component.
1. Initialize |viewport|'s {{XRViewport/y}} to |glViewport|'s <code>y</code> component.
1. Initialize |viewport|'s {{XRViewport/width}} to |glViewport|'s <code>width</code>.
Expand Down