[Public WebGL] Oversight in bufferData and bufferSubData specification

Chris Marrin [email protected]
Tue May 24 09:08:42 PDT 2011


On May 23, 2011, at 10:18 PM, Cedric Vivier wrote:

> 
> ...Uniformity is not relevant here.
> If you upload an UInt8Array, you convey the intent that you will
> likely use at least one attrib of UNSIGNED_BYTE.
> If you upload an Float32Array, you convey the intent that you will
> likely use at least one attrib of FLOAT.
> 
> As you'll never be able to use one attrib of DOUBLE, it breaks this "contract".

If I were using an interleaved buffer I would use ArrayBuffer to avoid the confusion of passing a buffer of a particular type that actually contains other types. So I haven't signed any contract in that case. The only contract you make when using bufferData() is that you promise that the type(s) of data in the buffer will match your use of them in the GPU. It's one of the areas a WebGL developer has to use care. Unless we make a complete system of always guaranteeing type match between bufferData and the use of the data, which we discussed and deemed too cumbersome, we can't really protect the author in any meaningful way.

-----
~Chris
[email protected]




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