Skip to content

Commit c97b985

Browse files
authored
Merge pull request immersive-web#301 from cabanier/stopclearing
Add option to skip the clearing of textures
2 parents d5acd70 + 66398b3 commit c97b985

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

webxrlayers-1.bs

+8-1
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,8 @@ An [=opaque texture=] functions identically to a standard {{WebGLTexture}} with
867867
- An [=opaque texture=] MUST behave as though it was allocated with [=texStorage2D=] or [=texStorage3D=], as appropriate, even when using a WebGL 1.0 context.
868868
- A call to {{deleteTexture}} with an [=opaque texture=] MUST generate an {{INVALID_OPERATION}} error.
869869

870-
The buffers attached to an [=opaque texture=] MUST be cleared to the values in the table below during the processing of the first call to {{XRWebGLBinding/getViewSubImage()}} or {{XRWebGLBinding/getSubImage()}} in each [=XR animation frame=].
870+
The buffers attached to an [=opaque texture=] MUST be cleared to the values in the table below during the processing of the first call to {{XRWebGLBinding/getViewSubImage()}} or {{XRWebGLBinding/getSubImage()}} in each [=XR animation frame=] when {{XRProjectionLayerInit/clearOnAccess}} is <code>true</code>.
871+
If {{XRProjectionLayerInit/clearOnAccess}} is <code>false</code>, the buffers attached to an [=opaque texture=] MUST be cleared the first time that they are accessed. Subsequent accesses in later frames MAY NOT clear the buffers.
871872

872873
<table class="tg">
873874
<thead>
@@ -919,6 +920,7 @@ dictionary XRProjectionLayerInit {
919920
GLenum colorFormat = 0x1908; // RGBA
920921
GLenum depthFormat = 0x1902; // DEPTH_COMPONENT
921922
double scaleFactor = 1.0;
923+
boolean clearOnAccess = true;
922924
};
923925
</pre>
924926

@@ -962,6 +964,8 @@ For {{WebGL2RenderingContext}} contexts these additional formats are supported:
962964
The <dfn dict-member for="XRProjectionLayerInit">scaleFactor</dfn> attribute defines the value that the |session|'s
963965
[=recommended WebGL framebuffer resolution=] MUST be multiplied by determining the resolution of the layer's attachments.
964966

967+
The <dfn dict-member for="XRProjectionLayerInit">clearOnAccess</dfn> attribute defines if the texture associated with this layer should be cleared in the initial frame or on every frame.
968+
965969
NOTE: the {{XRProjectionLayerInit}} dictionary does not have support to configure {{XRLayerInit/mipLevels}} like
966970
{{XRLayerInit}}. If a user agent wants to support mipmapping on projection layers, it is free to allocate the texture with mips.
967971
In that case the user agent (and not the author) is responsible for generating all the mip levels.
@@ -981,6 +985,7 @@ dictionary XRLayerInit {
981985
required unsigned long viewPixelHeight;
982986
XRLayerLayout layout = "mono";
983987
boolean isStatic = false;
988+
boolean clearOnAccess = true;
984989
};
985990
</pre>
986991

@@ -1034,6 +1039,8 @@ the rectangular dimensions of the {{XRCompositionLayer}}.
10341039

10351040
The <dfn dict-member for="XRLayerInit">layout</dfn> attribute defines the layout of the layer.
10361041

1042+
The <dfn dict-member for="XRLayerInit">clearOnAccess</dfn> attribute defines if the texture associated with this layer should be cleared in the initial frame or on every frame.
1043+
10371044
XRQuadLayerInit {#xrquadlayerinit}
10381045
-------------------
10391046

0 commit comments

Comments
 (0)