Implement dirty bits acceleration for VertexArrayGL.
BUG=angleproject:1040
TEST=angle_end2end_tests,angle_perftests,WebGL
Change-Id: I91d9aea5eefb58ecaf5b1cc95926fddb2aa846ea
Reviewed-on: https://chromium-review.googlesource.com/289570
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/State.cpp b/src/libANGLE/State.cpp
index 5791cb9..752f995 100644
--- a/src/libANGLE/State.cpp
+++ b/src/libANGLE/State.cpp
@@ -846,6 +846,8 @@
void State::setVertexArrayBinding(VertexArray *vertexArray)
{
mVertexArray = vertexArray;
+ mDirtyBits.set(DIRTY_BIT_VERTEX_ARRAY_BINDING);
+ mDirtyBits.set(DIRTY_BIT_VERTEX_ARRAY_OBJECT);
}
GLuint State::getVertexArrayId() const
@@ -865,6 +867,8 @@
if (mVertexArray->id() == vertexArray)
{
mVertexArray = NULL;
+ mDirtyBits.set(DIRTY_BIT_VERTEX_ARRAY_BINDING);
+ mDirtyBits.set(DIRTY_BIT_VERTEX_ARRAY_OBJECT);
return true;
}
@@ -1051,6 +1055,7 @@
void State::setEnableVertexAttribArray(unsigned int attribNum, bool enabled)
{
getVertexArray()->enableAttribute(attribNum, enabled);
+ mDirtyBits.set(DIRTY_BIT_VERTEX_ARRAY_OBJECT);
}
void State::setVertexAttribf(GLuint index, const GLfloat values[4])
@@ -1074,10 +1079,23 @@
mDirtyBits.set(DIRTY_BIT_CURRENT_VALUE_0 + index);
}
-void State::setVertexAttribState(unsigned int attribNum, Buffer *boundBuffer, GLint size, GLenum type, bool normalized,
- bool pureInteger, GLsizei stride, const void *pointer)
+void State::setVertexAttribState(unsigned int attribNum,
+ Buffer *boundBuffer,
+ GLint size,
+ GLenum type,
+ bool normalized,
+ bool pureInteger,
+ GLsizei stride,
+ const void *pointer)
{
getVertexArray()->setAttributeState(attribNum, boundBuffer, size, type, normalized, pureInteger, stride, pointer);
+ mDirtyBits.set(DIRTY_BIT_VERTEX_ARRAY_OBJECT);
+}
+
+void State::setVertexAttribDivisor(GLuint index, GLuint divisor)
+{
+ getVertexArray()->setVertexAttribDivisor(index, divisor);
+ mDirtyBits.set(DIRTY_BIT_VERTEX_ARRAY_OBJECT);
}
const VertexAttribCurrentValueData &State::getVertexAttribCurrentValue(unsigned int attribNum) const