Skip to content
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

[webgl2 spec] "shader-output-incompatible" draw buffer validation. #3626

Merged
merged 2 commits into from
Apr 4, 2024
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
24 changes: 17 additions & 7 deletions specs/latest/2.0/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3720,16 +3720,26 @@ <h3>Draw Buffers</h3>
</div>

<p>
If the values written by the fragment shader do not match the format(s) of the corresponding
color buffer(s) (for example, the output variable is an integer, but the corresponding color
buffer has a floating-point format, or vice versa), and the color buffer states are not set to
<code>NONE</code> by <code>DrawBuffers</code>, draws generate an <code>INVALID_OPERATION</code> error;
if the color buffer states are set to <code>NONE</code> by <code>DrawBuffers</code>, they remain untouched.
A draw buffer is "shader-output-incompatible" with a fragment shader if:
<ul>
<li>the values written to it by the shader do not match the format of the corresponding color buffer
(For example, the output variable is an integer, but the corresponding color buffer has a floating-point format, or vice versa)
</li>
<li>OR there is no defined fragment shader output for its location.</li>
</ul>
</p>

<p>
If any draw buffer with an attachment does not have a defined fragment shader output, draws
generate <code>INVALID_OPERATION</code>, unless all 4 channels of <code>colorMask</code> are set to false.
If any draw buffers are "shader-output-incompatible", draws generate <code>INVALID_OPERATION</code> if:
<ul>
<li>Any channel of <code>colorMask</code> is set to true</li>
<li>AND, for each <code>DRAW_BUFFERi</code> of <code>DRAW_FRAMEBUFFER</code> that is "shader-output-incompatible":
<ul>
<li><code>DRAW_BUFFERi</code> is not <code>NONE</code></li>
<li>AND, any channel <code>colorMaski</code> (from e.g. OES_draw_buffers_indexed) is set to true.</li>
</ul>
</li>
</ul>
</p>

<h3>No Program Binaries</h3>
Expand Down
Loading