Disable vertex attributes if not active in program

Even if explicitly enabled.

Bug: angleproject:2138
Change-Id: I598d21296bb6843e05cdeab146c1ff3da3a1174b
Reviewed-on: https://chromium-review.googlesource.com/1185743
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
diff --git a/src/libANGLE/VertexArray.cpp b/src/libANGLE/VertexArray.cpp
index 88eff70..25f529b 100644
--- a/src/libANGLE/VertexArray.cpp
+++ b/src/libANGLE/VertexArray.cpp
@@ -310,8 +310,12 @@
 
     VertexAttribute &attrib = mState.mVertexAttributes[attribIndex];
 
+    if (mState.mEnabledAttributesMask.test(attribIndex) == enabledState)
+    {
+        return;
+    }
+
     attrib.enabled = enabledState;
-    mState.mVertexAttributesTypeMask.setIndex(GetVertexAttributeBaseType(attrib), attribIndex);
 
     setDirtyAttribBit(attribIndex, DIRTY_ATTRIB_ENABLED);