Optimize ValidateDrawAttribs: Part 1.
This moves several loop checks outside the loop, and uses more of the
gl::AttributesMask class to do bitset operations instead of using
checks and for loops.
Bug: angleproject:1391
Change-Id: I90a1a7db550390ecd1402cf5a8a6677fd852b7b0
Reviewed-on: https://chromium-review.googlesource.com/1008273
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/VertexArray.cpp b/src/libANGLE/VertexArray.cpp
index 06362d0..37ad8b7 100644
--- a/src/libANGLE/VertexArray.cpp
+++ b/src/libANGLE/VertexArray.cpp
@@ -36,6 +36,11 @@
return (mClientMemoryAttribsMask & mEnabledAttributesMask);
}
+bool VertexArrayState::hasEnabledNullPointerClientArray() const
+{
+ return (mNullPointerClientMemoryAttribsMask & mEnabledAttributesMask).any();
+}
+
// VertexArray implementation.
VertexArray::VertexArray(rx::GLImplFactory *factory,
GLuint id,
@@ -272,6 +277,8 @@
setDirtyAttribBit(attribIndex, DIRTY_ATTRIB_POINTER);
mState.mClientMemoryAttribsMask.set(attribIndex, boundBuffer == nullptr);
+ mState.mNullPointerClientMemoryAttribsMask.set(attribIndex,
+ boundBuffer == nullptr && pointer == nullptr);
}
void VertexArray::setElementArrayBuffer(const Context *context, Buffer *buffer)