Optimize more front-end VertexArray binding.
Improves perf slightly (1-2%) in the Vulkan VBO state change test.
Bug: angleproject:3014
Change-Id: Ia8082b5b3f5e847a6b2775e896893fa8d38c1afd
Reviewed-on: https://chromium-review.googlesource.com/c/1393904
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
diff --git a/src/libANGLE/State.cpp b/src/libANGLE/State.cpp
index 2745b84..fb65fa3 100644
--- a/src/libANGLE/State.cpp
+++ b/src/libANGLE/State.cpp
@@ -355,7 +355,7 @@
// Set all indexes in state attributes type mask to float (default)
for (int i = 0; i < MAX_VERTEX_ATTRIBS; i++)
{
- mCurrentValuesTypeMask.setIndex(GL_FLOAT, i);
+ SetComponentTypeMask(ComponentType::Float, i, &mCurrentValuesTypeMask);
}
mUniformBuffers.resize(caps.maxUniformBufferBindings);
@@ -1621,7 +1621,7 @@
mVertexAttribCurrentValues[index].setFloatValues(values);
mDirtyBits.set(DIRTY_BIT_CURRENT_VALUES);
mDirtyCurrentValues.set(index);
- mCurrentValuesTypeMask.setIndex(GL_FLOAT, index);
+ SetComponentTypeMask(ComponentType::Float, index, &mCurrentValuesTypeMask);
}
void State::setVertexAttribu(GLuint index, const GLuint values[4])
@@ -1630,7 +1630,7 @@
mVertexAttribCurrentValues[index].setUnsignedIntValues(values);
mDirtyBits.set(DIRTY_BIT_CURRENT_VALUES);
mDirtyCurrentValues.set(index);
- mCurrentValuesTypeMask.setIndex(GL_UNSIGNED_INT, index);
+ SetComponentTypeMask(ComponentType::UnsignedInt, index, &mCurrentValuesTypeMask);
}
void State::setVertexAttribi(GLuint index, const GLint values[4])
@@ -1639,7 +1639,7 @@
mVertexAttribCurrentValues[index].setIntValues(values);
mDirtyBits.set(DIRTY_BIT_CURRENT_VALUES);
mDirtyCurrentValues.set(index);
- mCurrentValuesTypeMask.setIndex(GL_INT, index);
+ SetComponentTypeMask(ComponentType::Int, index, &mCurrentValuesTypeMask);
}
void State::setVertexAttribDivisor(const Context *context, GLuint index, GLuint divisor)