[Public WebGL] Oversight in bufferData and bufferSubData specification

Chris Marrin [email protected]
Mon May 23 14:32:51 PDT 2011


On May 23, 2011, at 11:46 AM, Cedric Vivier wrote:

> 
> On Tue, May 24, 2011 at 01:33, Kenneth Russell <[email protected]> wrote:
>> Supporting uploading of Float64Arrays with no error reporting at all
>> gives the incorrect impression that such data can somehow be validly
>> referenced on the GPU, which it can't in the OpenGL ES 2.0 API. At a
>> minimum I think that an OpenGL error should be raised if one is passed
>> to bufferData or bufferSubData.
> 
> I agree with Ken, as long the IDL is kept flexible as it is now.
> An INVALID_VALUE would help debug invalid/garbage output a developer
> would be seeing because of a simple 'typo'.

I don't think Float64Array vs Float32Array is a simple typo. It is a basic misunderstanding by the author. There are so many other ways an author can make a mistake sending data to the GPU, catching this one isn't going to help much. All we'd be doing would be tying the hands of authors who are being clever. 

> 
> People doing advanced stuff like interleaving with 64-bit floats would
> still be able to use their buffers, casting to Float32 first (which
> better expresses the intent [ie. "this ArrayBuffer is interleaved with
> 64-bit floats but I want to use 32-bit floats with this GL buffer"]).

There are plenty of workarounds. But why do this check when it would have little or no real value? That is, of course, my opinion. But I don't like the idea of putting in error checking unless there is good evidence that there is a real problem to be addressed.

-----
~Chris
[email protected]




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




More information about the public_webgl mailing list