Only sync attributes used by the current program in RendererGL.

Improves draw call overhead of RendererGL.

DrawCallPerf_gl:
Before: 136973 score
After: 153317 score
Improvement: 11.932%

BUG=angleproject:959

Change-Id: Ib75f6fdd756648e4a07f6e970cda03abbdbcf009
Reviewed-on: https://chromium-review.googlesource.com/275409
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/renderer/gl/ProgramGL.cpp b/src/libANGLE/renderer/gl/ProgramGL.cpp
index 2257601..9017762 100644
--- a/src/libANGLE/renderer/gl/ProgramGL.cpp
+++ b/src/libANGLE/renderer/gl/ProgramGL.cpp
@@ -197,6 +197,8 @@
 
         // TODO: determine attribute precision
         setShaderAttribute(static_cast<size_t>(i), attributeType, GL_NONE, attributeName, attributeSize, location);
+
+        mActiveAttributeLocations.push_back(location);
     }
 
     return LinkResult(true, gl::Error(GL_NO_ERROR));
@@ -434,6 +436,7 @@
 
     mSamplerUniformMap.clear();
     mSamplerBindings.clear();
+    mActiveAttributeLocations.clear();
 }
 
 GLuint ProgramGL::getProgramID() const
@@ -446,4 +449,9 @@
     return mSamplerBindings;
 }
 
+const std::vector<GLuint> &ProgramGL::getActiveAttributeLocations() const
+{
+    return mActiveAttributeLocations;
+}
+
 }