ES31: Enable atomic counter for GL backend

This simply translates the offset qualifier and synchronizes
the buffer binding state for GL translator and renderer.

BUG=angleproject:1729
TEST=angle_end2end_tests:AtomicCounterBufferTest31

Change-Id: Ib8424918478ae4c47049d5856ea20ef022f12913
Reviewed-on: https://chromium-review.googlesource.com/575913
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/compiler/translator/OutputGLSLBase.cpp b/src/compiler/translator/OutputGLSLBase.cpp
index 976ce4c..b7aacee 100644
--- a/src/compiler/translator/OutputGLSLBase.cpp
+++ b/src/compiler/translator/OutputGLSLBase.cpp
@@ -246,6 +246,11 @@
         }
     }
 
+    if (IsAtomicCounter(type.getBasicType()))
+    {
+        out << listItemPrefix << "offset = " << layoutQualifier.offset;
+    }
+
     out << ") ";
 }
 
diff --git a/src/compiler/translator/Types.cpp b/src/compiler/translator/Types.cpp
index 2dd55ac..122be15 100644
--- a/src/compiler/translator/Types.cpp
+++ b/src/compiler/translator/Types.cpp
@@ -417,6 +417,9 @@
         case EbtUImageCube:
             mangledName += "uimc";
             break;
+        case EbtAtomicCounter:
+            mangledName += "ac";
+            break;
         case EbtStruct:
             mangledName += structure->mangledName();
             break;