The omission was noted by the WG at some point and was fixed in OpenGL ES 3.0 which statesI can't find any language in GLES or GL about ReadPixels generating an error when there's no ColorAttachment0 (or ColorAttachmentI with ReadBuffer) to read from. Things that are mentioned: * INVALID_OP if ReadPixels `type` is float-y and the source is not, or vice versa. * INVALID_OP if ReadPixels `format` is DEPTH_COMPONENT, STENCIL_INDEX, or DEPTH_STENCIL and the source is missing any of the respective buffers. * INVALID_OP if the source is not FRAMEBUFFER_COMPLETE However, depth-only FBs can be FRAMEBUFFER_COMPLETE, which throws a wrench in things. The options: * zero-fills * [0,0,0,255]-fill (Chrome does this) * INVALID_OPERATION (Firefox does this) Thoughts? Maybe Mark or someone else knows more from the GL(ES) specs.
"ReadPixels generates an INVALID_OPERATION error if READ_-BUFFER is NONE or if the GL is using a framebuffer object (i.e. READ_-FRAMEBUFFER_BINDING is non-zero) and the read buffer selects an attachment that has no image attached."
So INVALID_OPERATION indeed is the right error to raise.
Not sure why the WG didn't fix the OpenGL ES 2.0 spec.
NOTE: This electronic mail message may contain confidential and privileged information from HI Corporation. If you are not the intended recipient, any disclosure, photocopying, distribution or use of the contents of the received information is prohibited. If you have received this e-mail in error, please notify the sender immediately and permanently delete this message and all related copies.