[Public WebGL] Spec for readPixels is needlessly confusing

Boris Zbarsky [email protected]
Fri Apr 20 20:05:02 PDT 2012

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


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