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

Clarify draw calls with incompatible render targets #3623

Closed
lexaknyazev opened this issue Feb 8, 2024 · 0 comments · Fixed by #3626
Closed

Clarify draw calls with incompatible render targets #3623

lexaknyazev opened this issue Feb 8, 2024 · 0 comments · Fixed by #3626

Comments

@lexaknyazev
Copy link
Member

The WebGL 2.0 spec says the following:

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 NONE by DrawBuffers, draws generate an INVALID_OPERATION error; if the color buffer states are set to NONE by DrawBuffers, they remain untouched.

If any draw buffer with an attachment does not have a defined fragment shader output, draws generate INVALID_OPERATION, unless all 4 channels of colorMask are set to false.

  1. The language above does not explicitly address the following case: a draw buffer is enabled, has an attachment of an incompatible format (e.g., an integer attachment for a floating-point fragment shader output), and all 4 channels of colorMask are set to false.
  2. Are there any interactions with OES_draw_buffers_indexed? I.e., should indexed color masks be considered for these rules?
kdashg added a commit that referenced this issue Apr 4, 2024
…3626)

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

Fixes #3623.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant