Commit eea3a6e0 by Jamie Madill

Micro-optimize State::hasMappedBuffer.

This speeds up draw call validation. BUG=angleproject:959 Change-Id: I8272e36201521f158823739a6604444fb5e66b6e Reviewed-on: https://chromium-review.googlesource.com/266025Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarBrandon Jones <bajones@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent cd94ef96
...@@ -1406,9 +1406,10 @@ bool State::hasMappedBuffer(GLenum target) const ...@@ -1406,9 +1406,10 @@ bool State::hasMappedBuffer(GLenum target) const
if (target == GL_ARRAY_BUFFER) if (target == GL_ARRAY_BUFFER)
{ {
const VertexArray *vao = getVertexArray(); const VertexArray *vao = getVertexArray();
for (size_t attribIndex = 0; attribIndex < mVertexAttribCurrentValues.size(); attribIndex++) const auto &vertexAttribs = vao->getVertexAttributes();
for (size_t attribIndex = 0; attribIndex < vertexAttribs.size(); attribIndex++)
{ {
const gl::VertexAttribute &vertexAttrib = vao->getVertexAttribute(attribIndex); const gl::VertexAttribute &vertexAttrib = vertexAttribs[attribIndex];
gl::Buffer *boundBuffer = vertexAttrib.buffer.get(); gl::Buffer *boundBuffer = vertexAttrib.buffer.get();
if (vertexAttrib.enabled && boundBuffer && boundBuffer->isMapped()) if (vertexAttrib.enabled && boundBuffer && boundBuffer->isMapped())
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment