Don't use a helper function to get the vertex attributes.
The overhead of the function call ended up being a hot spot for draw calls
since the attributes are iterated over many times in VertexDataManager.
BUG=angleproject:959
Change-Id: I9bbfcbd115661ad629db9ed93d683cd8d0dc9a78
Reviewed-on: https://chromium-review.googlesource.com/263102
Tested-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/State.cpp b/src/libANGLE/State.cpp
index e199890..15274c6 100644
--- a/src/libANGLE/State.cpp
+++ b/src/libANGLE/State.cpp
@@ -1055,11 +1055,6 @@
getVertexArray()->setAttributeState(attribNum, boundBuffer, size, type, normalized, pureInteger, stride, pointer);
}
-const VertexAttribute &State::getVertexAttribState(unsigned int attribNum) const
-{
- return getVertexArray()->getVertexAttribute(attribNum);
-}
-
const VertexAttribCurrentValueData &State::getVertexAttribCurrentValue(unsigned int attribNum) const
{
ASSERT(static_cast<size_t>(attribNum) < mVertexAttribCurrentValues.size());
@@ -1451,9 +1446,10 @@
{
if (target == GL_ARRAY_BUFFER)
{
+ const VertexArray *vao = getVertexArray();
for (size_t attribIndex = 0; attribIndex < mVertexAttribCurrentValues.size(); attribIndex++)
{
- const gl::VertexAttribute &vertexAttrib = getVertexAttribState(static_cast<unsigned int>(attribIndex));
+ const gl::VertexAttribute &vertexAttrib = vao->getVertexAttribute(attribIndex);
gl::Buffer *boundBuffer = vertexAttrib.buffer.get();
if (vertexAttrib.enabled && boundBuffer && boundBuffer->isMapped())
{