OSDN Git Service

[GLESv3][VAO] enable/pointer for vertex attribs when possible
authorLingfeng Yang <lfy@google.com>
Fri, 2 Dec 2016 16:02:15 +0000 (08:02 -0800)
committerLingfeng Yang <lfy@google.com>
Fri, 2 Dec 2016 20:15:18 +0000 (12:15 -0800)
commitfe2a31d63f6155121bc8eedf1d479d8696beff1d
tree485362843fbc38c872420a9ca9f7ea5d678f716a
parentecf56806f07388fcde5d21f3252bd0cc49b69cd1
[GLESv3][VAO] enable/pointer for vertex attribs when possible

If we don't forward enables/pointers to the host until
right before the draw, when a nonzero VAO is bound,
it defeats the purpose of VAO usage for performance.

This CL prepares the GLES2 encoder for VAO usage by
forwarding those calls whenever possible.

It gives a flag to sendVertexAttributes to not do any
changes in GL state if all attributes are backed by VBOs.

The reason we don't forward them 100% is because of
supporting either legacy or tricky behavior:

Legacy: specifying vertex arrays from host memory directly
with a host ptr passed to glVertexAttribPointer
Tricky: Using glVertexAttrib*f*(...) instead of
glVertexAttribPointer

Change-Id: I190aab86d7dcd7e01cfac0a1f60b44fac131abd0
system/GLESv2_enc/GL2Encoder.cpp
system/GLESv2_enc/GL2Encoder.h