[Public WebGL] Spec for readPixels is needlessly confusing

Kenneth Russell [email protected]
Fri Apr 27 14:20:35 PDT 2012

On Fri, Apr 20, 2012 at 8:05 PM, Boris Zbarsky <[email protected]> wrote:
> The spec for readPixels says:
>  The type of pixels must match the type of the data to be read. For
>  example, if it is UNSIGNED_BYTE, a Uint8Array must be supplied; if it
>  is UNSIGNED_SHORT_5_6_5, UNSIGNED_SHORT_4_4_4_4, or
>  UNSIGNED_SHORT_5_5_5_1, a Uint16Array must be supplied. If the types
>  do not match, an INVALID_OPERATION error is generated.
> but then it says "The following are the allowed format and type
> combinations:" and gives exactly one allowed combination: format = RGBA,
> The intent, apparently, is that in practice if anything other than
> format=RGBA, type=UNSIGNED_BYTE and a Uint8Array are passed in then
> INVALID_OPERATION is generated.  Why not just say that?  If the set of
> allowed formats/types ever changes, _then_ the verbiage about the types of
> ArrayBufferViews allowed can be updated accordingly.
> Also, while we're here, the "an INVALID_OPERATION value is generated"
> verbiage for when too-small array is passed should probably say "error", not
> "value".

Fixed the "value" -> "error" typo.

I've left the other text as is. It's likely that extensions or future
WebGL revisions will support more format/type combinations.


You are currently subscribed to [email protected]
To unsubscribe, send an email to [email protected] with
the following command in the body of your email:
unsubscribe public_webgl

More information about the public_webgl mailing list