Link atomic counters to buffers

Gather counters from each shader and group them according the
layout qualifier 'binding' into each buffer.

BUG=angleproject:1729
TEST=angle_end2end_tests:AtomicCounterBufferTest

Change-Id: I8d0cd0d2bf65be37c035b0e1540481c8bee0bae4
diff --git a/src/compiler/translator/ShaderVars.cpp b/src/compiler/translator/ShaderVars.cpp
index b40e610..7c2f9ce 100644
--- a/src/compiler/translator/ShaderVars.cpp
+++ b/src/compiler/translator/ShaderVars.cpp
@@ -210,7 +210,9 @@
 
 bool Uniform::isSameUniformAtLinkTime(const Uniform &other) const
 {
-    if (binding != other.binding)
+    // Enforce a consistent match.
+    // https://cvs.khronos.org/bugzilla/show_bug.cgi?id=16261
+    if (binding != -1 && other.binding != -1 && binding != other.binding)
     {
         return false;
     }
@@ -218,7 +220,6 @@
     {
         return false;
     }
-    // TODO(jie.a.chen@intel.com): Add a test case to cover this.
     if (offset != other.offset)
     {
         return false;