Skip to content

Commit

Permalink
Merge pull request #234 from cabanier/texture-clear
Browse files Browse the repository at this point in the history
Clarify that opaque textures are always initialized at the start of the frame
  • Loading branch information
cabanier committed Dec 17, 2020
2 parents 5455595 + 2051ae3 commit fe516db
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions webxrlayers-1.bs
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,31 @@ An [=opaque texture=] functions identically to a standard {{WebGLTexture}} with
- An [=opaque texture=] MUST behave as though it was allocated with [=texStorage2D=] or [=texStorage3D=], as appropriate, even when using a WebGL 1.0 context.
- A call to {{deleteTexture}} with an [=opaque texture=] MUST generate an {{INVALID_OPERATION}} error.

The buffers attached to an [=opaque texture=] MUST be cleared to the values in the table below prior to the processing of each [=XR animation frame=].

<table class="tg">
<thead>
<tr>
<th>Buffer</th>
<th>Clear Value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Color</td>
<td>(0, 0, 0, 0)</td>
</tr>
<tr>
<td>Depth</td>
<td>1.0</td>
</tr>
<tr>
<td>Stencil</td>
<td>0</td>
</tr>
</tbody>
</table>

NOTE: the [=opaque texture|opaque textures=] are allocated when the layer is contructed using the
[=allocate color textures=] and [=allocate depth textures=] algoritms. The side effect of this pre-allocation is that calling
{{XRWebGLBinding/getSubImage()}} and {{XRWebGLBinding/getViewSubImage()}} with the same parameters will always return the same texture objects.
Expand Down

0 comments on commit fe516db

Please sign in to comment.