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

Re: [Public WebGL] WebGL bufferSubData lacks "size" parameter

On Thu, Jan 12, 2012 at 10:26 AM, Chananya Freiman <spectralcanine@gmail.com> wrote:
Why would we need to write
bufferSubData(target, offset, new TypeArray(originalTypedArray.buffer, offset * sizeofType, offset * sizeofType + size)

Instead of a more obvious
bufferSubData(target, offset, originalTypedArray, size)

How would this help? you'd need 2 offsets, one into the buffer, another into the array. There's already a way to specify that. It's called creating a view. No need for 2 ways to achieve the same thing. One way = less bloat, less browser code, less chance for bugs, less error handling, less specification needed,


I put the size as the last parameter to allow the previous variations work without change. 

Forget for a moment speed and GC, this seems to be a lot more obvious.