Fix the regression bug for ComputeBoids
The old implementation missed considering compute program would also enter
into applyActiveAttribLocationsMask. However, there was no bindVertexArray
before updateAttribEnabled which resulted the previous VAO state was modified
in unknown. And that's why ComputeBoids example wouldn't work correctly.
This change adds a checking to not enter propagateProgramToVAO if it's a
compute program since compute shader doesn't have vertex attributes. And
an ASSERT is added to make sure that the right VAO is bound when
updateAttribEnabled is called in applyActiveAttribLocationsMask.
Bug: angleproject:2810
Change-Id: I6e77853498a527ef3b755bbb1da5826a9134b164
Reviewed-on: https://chromium-review.googlesource.com/c/1226227
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Jiajia Qin <jiajia.qin@intel.com>
diff --git a/src/libANGLE/renderer/gl/VertexArrayGL.cpp b/src/libANGLE/renderer/gl/VertexArrayGL.cpp
index c47e5e4..8135168 100644
--- a/src/libANGLE/renderer/gl/VertexArrayGL.cpp
+++ b/src/libANGLE/renderer/gl/VertexArrayGL.cpp
@@ -730,6 +730,11 @@
void VertexArrayGL::applyActiveAttribLocationsMask(const gl::AttributesMask &activeMask)
{
gl::AttributesMask updateMask = mProgramActiveAttribLocationsMask ^ activeMask;
+ if (!updateMask.any())
+ {
+ return;
+ }
+ ASSERT(mVertexArrayID == mStateManager->getVertexArrayID());
mProgramActiveAttribLocationsMask = activeMask;
for (size_t attribIndex : updateMask)