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

Re: [Public WebGL] Bufferdata behavior




On 8/29/12 5:27 PM, Kristian Sons wrote:
just found following inconsistent behavior in my (buggy) code :)

bufferData(GLenum target, ArrayBufferView data, GLenum usage)

If data is null Firefox and Chrome on Windows have the specified
behavior: INVALID_VALUE.
If data is undefined, it seems that Firefox creates a zero sized buffer,
while Chrome seems to just ignore that call.

Just to check, which version of Firefox were you testing? Firefox 15 switched the WebGLRenderingContext to WebIDL, so if you're testing an earlier version the behavior may be different from Firefox 15 and later.


In any case, per spec as it currently stands (and in Firefox 15 and later, based on code inspection), null and undefined should do the same thing. In particular, if you pass either one, you will call this overload:

  void bufferData(GLenum target, ArrayBuffer? data, GLenum usage);

and null will be passed for the data to the underlying implementation.

-Boris

-----------------------------------------------------------
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:
unsubscribe public_webgl
-----------------------------------------------------------