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

Re: [Public WebGL] Clarification to bufferData

On Thu, Nov 11, 2010 at 1:54 PM, Vladimir Vukicevic <vladimir@mozilla.com> wrote:

----- Original Message -----
> I've committed a small clarification to the bufferData variants taking
> ArrayBuffer and ArrayBufferView indicating that they generate an
> INVALID_VALUE error if null is passed for the buffer or view. This
> behavior is strongly desired because it is ill defined what happens
> otherwise. (Does the call become a no-op? Is the buffer object resized
> to zero size?)

FWIW, for us currently we try to convert the arg to a non-null ArrayBuffer or ArrayBufferView, and if that fails then we do the JS standard "ToInt32()" operation to get a size.  For null that'll give us back 0, so we end up treating it as resizing the buffer to 0-size.  Not sure if that's any better or worse; I have no problem with the change.

That seems more consistent with WebIDL.  Since one variant of bufferData takes a GLsizei you can basically pass anything to it and it should do the standard JS / EMCAScript thing which means passing null or "foo" or undefined etc will all convert to 0.

   - Vlad
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email: