ES31: Add atomic counter for GLSL parsing

This makes shader compiler support the new basic type 'atomic_uint'
and validate its layout qualifiers properly.

BUG=angleproject:1729
TEST=angle_unittests:AtomicCounterTest
     angle_deqp_gles31_tests:dEQP-GLES31.functional.atomic_counter.layout.invalid*
     angle_deqp_gles31_tests:dEQP-GLES31.functional.debug.negative_coverage.*.atomic*

Change-Id: Ia237eadf6ea72314f436a0abbb93a05598e71eba
Reviewed-on: https://chromium-review.googlesource.com/500088
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/common/utilities.cpp b/src/common/utilities.cpp
index 95fa4c8..d0db43e 100644
--- a/src/common/utilities.cpp
+++ b/src/common/utilities.cpp
@@ -157,6 +157,7 @@
       case GL_IMAGE_CUBE:
       case GL_INT_IMAGE_CUBE:
       case GL_UNSIGNED_INT_IMAGE_CUBE:
+      case GL_UNSIGNED_INT_ATOMIC_COUNTER:
           return GL_INT;
       case GL_UNSIGNED_INT:
       case GL_UNSIGNED_INT_VEC2:
@@ -277,6 +278,7 @@
       case GL_IMAGE_CUBE:
       case GL_INT_IMAGE_CUBE:
       case GL_UNSIGNED_INT_IMAGE_CUBE:
+      case GL_UNSIGNED_INT_ATOMIC_COUNTER:
           return 1;
       case GL_FLOAT_MAT2:
       case GL_FLOAT_MAT3x2:
@@ -340,6 +342,7 @@
       case GL_IMAGE_CUBE:
       case GL_INT_IMAGE_CUBE:
       case GL_UNSIGNED_INT_IMAGE_CUBE:
+      case GL_UNSIGNED_INT_ATOMIC_COUNTER:
           return 1;
       case GL_BOOL_VEC2:
       case GL_FLOAT_VEC2:
@@ -422,11 +425,15 @@
     return false;
 }
 
+bool IsAtomicCounterType(GLenum type)
+{
+    return type == GL_UNSIGNED_INT_ATOMIC_COUNTER;
+}
+
 bool IsOpaqueType(GLenum type)
 {
     // ESSL 3.10 section 4.1.7 defines opaque types as: samplers, images and atomic counters.
-    // TODO(oetuaho): add atomic types
-    return IsImageType(type) || IsSamplerType(type);
+    return IsImageType(type) || IsSamplerType(type) || IsAtomicCounterType(type);
 }
 
 GLenum SamplerTypeToTextureType(GLenum samplerType)