Skip to content

Commit a69c050

Browse files
committed
Move direct output flag to render state
1 parent dadb198 commit a69c050

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

index.bs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,13 @@ When requested, the {{XRSession}} MUST <dfn>apply pending render states</dfn> by
491491
<dt> Otherwise
492492
<dd> Set |activeState|'s [=XRRenderState/output canvas=] to <code>null</code>.
493493
</dl>
494+
1. Set |activeState|'s [=XRRenderState/direct output=] boolean based on the following:
495+
<dl class="switch">
496+
<dt> If |session|'s [=XRSession/mode=] is {{XRSessionMode/inline}} and |baseLayer| is an instance of an {{XRWebGLLayer}} with [=XRWebGLLayer/use default framebuffer=] set to <code>true</code>
497+
<dd> Set |activeState|'s [=XRRenderState/direct output=] to <code>true</code>
498+
<dt> Otherwise
499+
<dd> Set |activeState|'s [=XRRenderState/direct output=] boolean to <code>false</code>.
500+
</dl>
494501

495502
</div>
496503

@@ -568,20 +575,7 @@ The <dfn attribute for="XRSession">environmentBlendMode</dfn> attribute returns
568575

569576
NOTE: Most Virtual Reality devices exhibit {{XREnvironmentBlendMode/opaque}} blending behavior. Augmented Reality devices that use transparent optical elements frequently exhibit {{XREnvironmentBlendMode/additive}} blending behavior, and Augmented Reality devices that use passthrough cameras frequently exhibit {{XREnvironmentBlendMode/alpha-blend}} blending behavior.
570577

571-
An {{XRSessionMode/inline}} {{XRSession}} is considered a <dfn for="XRSession">direct output session</dfn> if rendering commands performed for the {{XRSession}} are executed in such a way that they are directly displayed on the page, rather than being processed by the [=XR Compositor=].
572-
573-
<div class="algorithm" data-algorithm="determine-direct-output-session">
574-
575-
To determine if an {{XRSession}} |session| is a [=direct output session=], the user agent MUST run the following steps:
576-
577-
1. If |session|'s [=XRSession/mode=] is not {{XRSessionMode/inline}}, return <code>false</code>.
578-
1. Let |baseLayer| be |session|'s {{XRSession/renderState}}'s {{XRRenderState/baseLayer}}.
579-
1. If |baseLayer| is an instance of an {{XRWebGLLayer}} with a [=XRWebGLLayer/use default framebuffer=] boolean set to <code>true</code>, return <code>true</code>.
580-
1. return <code>false</code>.
581-
582-
</div>
583-
584-
Each {{XRSession}} has a <dfn for="XRSession">viewer reference space</dfn>, which is an {{XRReferenceSpace}} of type {{XRReferenceSpaceType/viewer}} with an [=identity transform=] [=XRSpace/origin offset=]. The [=XRSession/viewer reference space=] has a <dfn for="XRSession/viewer reference space">list of views</dfn>, which is a [=/list=] of [=view=]s corresponding to the views provided by the [=/XR device=]. If the {{XRSession}} is a [=direct output session=] the [=list of views=] MUST contain a single [=view=].
578+
Each {{XRSession}} has a <dfn for="XRSession">viewer reference space</dfn>, which is an {{XRReferenceSpace}} of type {{XRReferenceSpaceType/viewer}} with an [=identity transform=] [=XRSpace/origin offset=]. The [=XRSession/viewer reference space=] has a <dfn for="XRSession/viewer reference space">list of views</dfn>, which is a [=/list=] of [=view=]s corresponding to the views provided by the [=/XR device=]. If the {{XRSession}}'s {{XRSession/renderState}} is in [=XRRenderState/direct output=] mode the [=list of views=] MUST contain a single [=view=].
585579

586580
<section class="unstable">
587581
The <dfn attribute for="XRSession">onblur</dfn> attribute is an [=Event handler IDL attribute=] for the {{blur}} event type.
@@ -628,7 +622,11 @@ dictionary XRRenderStateInit {
628622
};
629623
</pre>
630624

631-
Each {{XRRenderState}} has a <dfn for="XRRenderState">output canvas</dfn>, which is an {{HTMLCanvasElement}}. The [=XRRenderState/output canvas=] is the DOM element that will display any content rendered for an {{XRSessionMode/inline}} {{XRSession}}.
625+
Each {{XRRenderState}} has a <dfn for="XRRenderState">output canvas</dfn>, which is an {{HTMLCanvasElement}} initially set to <code>null</code>. The [=XRRenderState/output canvas=] is the DOM element that will display any content rendered for an {{XRSessionMode/inline}} {{XRSession}}.
626+
627+
Each {{XRRenderState}} also has <dfn for="XRRenderState">direct output</dfn> boolean, which is initially <code>false</code>. The {{XRRenderState}} is considered to be in [=XRRenderState/direct output=] mode if rendering commands performed for an {{XRSessionMode/inline}} {{XRSession}} are executed in such a way that they are directly displayed on the page, rather than being processed by the [=XR Compositor=].
628+
629+
Note: At this point the {{XRRenderState}} will only have an [=XRRenderState/output canvas=] if it is in [=XRRenderState/direct output=] mode, but future versions of the specification are likely to introduce methods for setting [=XRRenderState/output canvas=]' that support more advanced uses like mirroring and layer compositing that will not be [=XRRenderState/direct output=].
632630

633631
<div class="algorithm" data-algorithm="initialize-renderstate">
634632

@@ -645,7 +643,6 @@ When an {{XRRenderState}} object is created for an {{XRSession}} |session|, the
645643
<dd> Initialize |state|'s {{XRRenderState/inlineVerticalFieldOfView}} to <code>PI * 0.5</code>.
646644
</dl>
647645
1. Initialize |state|'s {{XRRenderState/baseLayer}} to <code>null</code>.
648-
1. Initialize |state|'s [=XRRenderState/output canvas=] to <code>null</code>.
649646

650647
</div>
651648

0 commit comments

Comments
 (0)