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/validationES.cpp b/src/libANGLE/validationES.cpp
index f4e64b7..16ccd0a 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -47,8 +47,7 @@
const VertexArray *vao = state.getVertexArray();
const auto &vertexAttribs = vao->getVertexAttributes();
const auto &vertexBindings = vao->getVertexBindings();
- size_t maxEnabledAttrib = vao->getMaxEnabledAttribute();
- for (size_t attributeIndex = 0; attributeIndex < maxEnabledAttrib; ++attributeIndex)
+ for (size_t attributeIndex : vao->getEnabledAttributesMask())
{
const VertexAttribute &attrib = vertexAttribs[attributeIndex];