Optimize ValidateDrawAttribs: Part 3.
This is a small optimization for the WebGL compatibility mode.
Instead of scanning the list of attributes for a Transform feedback
conflict, it can quickly check a cached mask. This should save a lot
of cycles on the fast path.
Bug: angleproject:1391
Change-Id: Icb8d095493a629dbff0e93872357e5bf7c7458ae
Reviewed-on: https://chromium-review.googlesource.com/1011236
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index 5bd5ad7..172d2aa 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -172,24 +172,10 @@
}
}
- // TODO(jmadill): Cache this. http://anglebug.com/1391
- if (webglCompatibility)
+ if (webglCompatibility && vao->hasTransformFeedbackBindingConflict(activeAttribs))
{
- for (size_t attributeIndex : activeAttribs)
- {
- const VertexAttribute &attrib = vertexAttribs[attributeIndex];
- ASSERT(attrib.enabled);
-
- const VertexBinding &binding = vertexBindings[attrib.bindingIndex];
-
- gl::Buffer *buffer = binding.getBuffer().get();
- if (buffer && buffer->isBoundForTransformFeedbackAndOtherUse())
- {
- ANGLE_VALIDATION_ERR(context, InvalidOperation(),
- VertexBufferBoundForTransformFeedback);
- return false;
- }
- }
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), VertexBufferBoundForTransformFeedback);
+ return false;
}
return true;