[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Color reads from FBs with no ColorAttachment0



On 2014/02/13 11:19, Jeff Gilbert wrote:
I 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.
The omission was noted by the WG at some point and was fixed in OpenGL ES 3.0 which states

"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.

Regards

    -Mark

--
注意:この電子メールには、株式会社エイチアイの機密情報が含まれている場合が有ります。正式なメール受信者では無い場合はメール複製、 再配信または情報の使用を固く禁じております。エラー、手違いでこのメールを受け取られましたら削除を行い配信者にご連絡をお願いいたし ます.

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.