ES31: Refactor VertexArray for Vertex Attrib Binding

OpenGL ES3.1 feature Vertex Attrib Binding requires vertex arrays should
be split into two arrays:
1. an array of vertex buffer binding points, each of which specifies:
  - a bound buffer object,
  - a starting offset for vertex attribute data in that buffer object,
  - a stride used by all attributes using that binding point,
  - a frequency divisor used by all attributes using that binding point.
2. an array of generic vertex attribute format information records, each
of which specifies:
  - a reference to one of the new buffer binding points above,
  - a component count and format, and a normalization flag for the
    attribute data,
  - the offset of the attribute data relative to the base offset of each
    vertex found at the associated binding point.

Current ANGLE implementation simply uses a struct to represent a vertex
attribute object, which does not meet the requirements above.

This patch aims to be the the basis of the implementation of all ES3.1
Vertex Attrib Binding APIs by refactoring the struct VertexAttribute and
the class VertexArray to fit the new data layout and ensuring all current
functionality is retained.

BUG=angleproject:1593

TEST=angle_unittests, angle_end2end_tests, gpu_unittests

Change-Id: Ieb41f1bf503f815fd0476d2ea045dcb863465254
Reviewed-on: https://chromium-review.googlesource.com/418880
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/State.cpp b/src/libANGLE/State.cpp
index be03719..fd98a6f 100644
--- a/src/libANGLE/State.cpp
+++ b/src/libANGLE/State.cpp
@@ -1945,13 +1945,14 @@
 {
     if (target == GL_ARRAY_BUFFER)
     {
-        const VertexArray *vao = getVertexArray();
+        const VertexArray *vao     = getVertexArray();
         const auto &vertexAttribs = vao->getVertexAttributes();
+        const auto &vertexBindings = vao->getVertexBindings();
         size_t maxEnabledAttrib = vao->getMaxEnabledAttribute();
         for (size_t attribIndex = 0; attribIndex < maxEnabledAttrib; attribIndex++)
         {
             const gl::VertexAttribute &vertexAttrib = vertexAttribs[attribIndex];
-            gl::Buffer *boundBuffer = vertexAttrib.buffer.get();
+            auto *boundBuffer = vertexBindings[vertexAttrib.bindingIndex].buffer.get();
             if (vertexAttrib.enabled && boundBuffer && boundBuffer->isMapped())
             {
                 return true;