Commit a492883b by Dian Xiang Committed by Jamie Madill

Optimizing updatecachedInputLayout to not update inactive vertex attribs

BUG=angleproject:1158 part a We only need to iterate and update the active attributes in a program. This can further be optimized by updating the cache more intelligently, possibly by marking attributes as "need update" when necessary Change-Id: I41e9c033116582c82a56b8d20ea245f06e8fa3d1 Reviewed-on: https://chromium-review.googlesource.com/299758Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 959e197c
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "libANGLE/renderer/d3d/ProgramD3D.h" #include "libANGLE/renderer/d3d/ProgramD3D.h"
#include "common/BitSetIterator.h"
#include "common/utilities.h" #include "common/utilities.h"
#include "libANGLE/Framebuffer.h" #include "libANGLE/Framebuffer.h"
#include "libANGLE/FramebufferAttachment.h" #include "libANGLE/FramebufferAttachment.h"
...@@ -1970,7 +1971,7 @@ void ProgramD3D::updateCachedInputLayout(const gl::State &state) ...@@ -1970,7 +1971,7 @@ void ProgramD3D::updateCachedInputLayout(const gl::State &state)
mCachedInputLayout.clear(); mCachedInputLayout.clear();
const auto &vertexAttributes = state.getVertexArray()->getVertexAttributes(); const auto &vertexAttributes = state.getVertexArray()->getVertexAttributes();
for (unsigned int attributeIndex = 0; attributeIndex < vertexAttributes.size(); attributeIndex++) for (unsigned int attributeIndex : angle::IterateBitSet(mData.getActiveAttribLocationsMask()))
{ {
int semanticIndex = mSemanticIndexes[attributeIndex]; int semanticIndex = mSemanticIndexes[attributeIndex];
......
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