Skip to content

Commit deb6236

Browse files
committed
Allow caching XRFrames
1 parent 24b3303 commit deb6236

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

index.bs

Lines changed: 7 additions & 1 deletion
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.

0 commit comments

Comments
 (0)