KhronosGroup/WebGL

Clarify draw calls with incompatible render targets

Closed this issue · 0 comments

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?