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

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




On Jan 11, 2012, at 1:35 PM, Chananya Freiman wrote:

> Both of these approaches work, except they are slower than just submitting the whole buffer by a magnitude.
> 
> I have a gigantic buffer of texture coordinates for a very big tile map (you know, rectangles).
> Since I am using a texture atlas, I need to change texture coordinates when I edit the images shown on tiles.
> 
> I thought that the viewVariable.buffer thing will work, but it's extremely slow, and so is subarray.
> 
> It only makes sense to have a size parameter for cases like this.

Please supply a test case where you're seeing this performance problem. Creating a typed array that is a view onto an existing ArrayBuffer should be extremely fast. It allows you to define a view into that buffer that has both an offset into the buffer and a different (shorter) length. That should allow you to do whatever you want without a significant performance penalty.

If you can show a case where you're seeing degraded performance it may be a bug in one or more browsers.

-----
~Chris
cmarrin@apple.com





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