VertexArray: Add enabled attribs bitmask.
This replaces the "max enabled attrib" integer with a bitmask of
enabled attribs. Should have better worst-case performance (only
attribute 15 is enabled) and similar best-case performance (when
only attribute 0 is enabled).
This might also help implementing validation optimizations.
Bug: angleproject:2202
Change-Id: I5cbb533c3af23851a42c80a6dc409a0da84e87c3
Reviewed-on: https://chromium-review.googlesource.com/847284
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/State.cpp b/src/libANGLE/State.cpp
index f60d491..93953c7 100644
--- a/src/libANGLE/State.cpp
+++ b/src/libANGLE/State.cpp
@@ -2205,8 +2205,7 @@
const VertexArray *vao = getVertexArray();
const auto &vertexAttribs = vao->getVertexAttributes();
const auto &vertexBindings = vao->getVertexBindings();
- size_t maxEnabledAttrib = vao->getMaxEnabledAttribute();
- for (size_t attribIndex = 0; attribIndex < maxEnabledAttrib; attribIndex++)
+ for (size_t attribIndex : vao->getEnabledAttributesMask())
{
const VertexAttribute &vertexAttrib = vertexAttribs[attribIndex];
auto *boundBuffer = vertexBindings[vertexAttrib.bindingIndex].getBuffer().get();