Clarify draw calls with incompatible render targets
Closed this issue · 0 comments
lexaknyazev commented
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
byDrawBuffers
, draws generate anINVALID_OPERATION
error; if the color buffer states are set toNONE
byDrawBuffers
, 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 ofcolorMask
are set to false.
- 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. - Are there any interactions with
OES_draw_buffers_indexed
? I.e., should indexed color masks be considered for these rules?