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

Re: [Public WebGL] ANGLE_instanced_arrays extension proposal





On Tue, Mar 6, 2012 at 2:57 PM, Kenneth Russell <kbr@google.com> wrote:
On Tue, Mar 6, 2012 at 2:47 PM, Florian Bösch <pyalot@gmail.com> wrote:
> I'd like to see this, and I do think it'd be particularly well suited to
> mobiles where there is generally less performance. One usecase I frequently
> miss (as well in any ARB extension) is to be able to draw the same vertex
> data repeatedly (without having to repeat the buffer). It seems to me the
> performance benefit would be substantial (but that's just a guess) because
> repeatedly accessing the same vertex data would make extremely good cache
> use as opposed to advancing trough a big buffer.

As John points out, current mobile hardware does not support this
functionality natively. In order to support this extension it would be
necessary to either shadow all vertex buffers (impractical due to the
high memory cost) or use OES_map_buffer to read back vertex data and
generate new vertex buffers on the fly for the instanced vertex
attributes.
 
Unfortunately OES_mapbuffer doesn't allow reading from a vertex buffer (if you want to be spec-compliant), so you'll have to do crazy things like create a special vertex buffer and set of shaders, and do a draw that dumps out the vertex buffer to an FBO, which you could then do a readback from.

If you want you could do that only on the first instanced draw from a buffer, and keep a shadow copy afterwards, but it might be difficult to make that perform well.

Does that change your thinking at all? I think this extension would be
a good idea, but that we should first implement the core functionality
planned for the next WebGL release and finish off the current crop of
draft extensions. Performance measurements of prototypes of this
extension would definitely motivate it. Maybe it would be worth moving
it to draft status and planning on leaving it there for a while.

-Ken