ES31: Add UNIFORM support for ProgramInterface

Add program resource properties for uniform.

BUG=angleproject:1920
TEST=angle_end2end_tests:ProgramInterfaceTest*

Change-Id: Ia5cf6219db43b8b1f73efbb3565d21c86e9d3ec0
Reviewed-on: https://chromium-review.googlesource.com/638050
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/UniformLinker.cpp b/src/libANGLE/UniformLinker.cpp
index f2df3af..f60897f 100644
--- a/src/libANGLE/UniformLinker.cpp
+++ b/src/libANGLE/UniformLinker.cpp
@@ -186,7 +186,7 @@
     {
         const LinkedUniform &uniform = mUniforms[uniformIndex];
 
-        if (uniform.isBuiltIn())
+        if (uniform.isBuiltIn() || IsAtomicCounterType(uniform.type))
         {
             continue;
         }
@@ -349,8 +349,8 @@
     ShaderUniformCount shaderUniformCount;
     for (const sh::Uniform &uniform : shader->getUniforms(context))
     {
-        shaderUniformCount +=
-            flattenUniform(uniform, &samplerUniforms, &imageUniforms, &atomicCounterUniforms);
+        shaderUniformCount += flattenUniform(uniform, &samplerUniforms, &imageUniforms,
+                                             &atomicCounterUniforms, shader->getType());
     }
 
     if (shaderUniformCount.vectorCount > maxUniformComponents)
@@ -448,12 +448,14 @@
     const sh::Uniform &uniform,
     std::vector<LinkedUniform> *samplerUniforms,
     std::vector<LinkedUniform> *imageUniforms,
-    std::vector<LinkedUniform> *atomicCounterUniforms)
+    std::vector<LinkedUniform> *atomicCounterUniforms,
+    GLenum shaderType)
 {
     int location                          = uniform.location;
-    ShaderUniformCount shaderUniformCount = flattenUniformImpl(
-        uniform, uniform.name, uniform.mappedName, samplerUniforms, imageUniforms,
-        atomicCounterUniforms, uniform.staticUse, uniform.binding, uniform.offset, &location);
+    ShaderUniformCount shaderUniformCount =
+        flattenUniformImpl(uniform, uniform.name, uniform.mappedName, samplerUniforms,
+                           imageUniforms, atomicCounterUniforms, shaderType, uniform.staticUse,
+                           uniform.binding, uniform.offset, &location);
     if (uniform.staticUse)
     {
         return shaderUniformCount;
@@ -468,6 +470,7 @@
     std::vector<LinkedUniform> *samplerUniforms,
     std::vector<LinkedUniform> *imageUniforms,
     std::vector<LinkedUniform> *atomicCounterUniforms,
+    GLenum shaderType,
     bool markStaticUse,
     int binding,
     int offset,
@@ -491,7 +494,7 @@
 
                 shaderUniformCount += flattenUniformImpl(
                     field, fieldFullName, fieldFullMappedName, samplerUniforms, imageUniforms,
-                    atomicCounterUniforms, markStaticUse, -1, -1, location);
+                    atomicCounterUniforms, shaderType, markStaticUse, -1, -1, location);
             }
         }
 
@@ -533,15 +536,20 @@
         if (markStaticUse)
         {
             existingUniform->staticUse = true;
+            MarkResourceStaticUse(existingUniform, shaderType, true);
         }
     }
     else
     {
         LinkedUniform linkedUniform(uniform.type, uniform.precision, fullName, uniform.arraySize,
-                                    binding, -1, *location, -1,
+                                    binding, offset, *location, -1,
                                     sh::BlockMemberInfo::getDefaultBlockInfo());
         linkedUniform.mappedName = fullMappedName;
         linkedUniform.staticUse = markStaticUse;
+        if (markStaticUse)
+        {
+            MarkResourceStaticUse(&linkedUniform, shaderType, true);
+        }
 
         uniformList->push_back(linkedUniform);
     }