Retrieve active uniforms.

TRAC #22239
Signed-off-by: Daniel Koch
Signed-off-by: Shannon Woods
Author: Nicolas Capens

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1626 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Shader.cpp b/src/libGLESv2/Shader.cpp
index 7051b34..81dde92 100644
--- a/src/libGLESv2/Shader.cpp
+++ b/src/libGLESv2/Shader.cpp
@@ -174,6 +174,11 @@
     getSourceImpl(mHlsl, bufSize, length, buffer);
 }
 
+const sh::ActiveUniforms &Shader::getUniforms()
+{
+    return mActiveUniforms;
+}
+
 bool Shader::isCompiled()
 {
     return mHlsl != NULL;
@@ -310,6 +315,8 @@
     mUsesFrontFacing = false;
     mUsesPointSize = false;
     mUsesPointCoord = false;
+
+    mActiveUniforms.clear();
 }
 
 void Shader::compileToHLSL(void *compiler)
@@ -355,6 +362,10 @@
         ShGetInfo(compiler, SH_OBJECT_CODE_LENGTH, &objCodeLen);
         mHlsl = new char[objCodeLen];
         ShGetObjectCode(compiler, mHlsl);
+
+        void *activeUniforms;
+        ShGetInfoPointer(compiler, SH_ACTIVE_UNIFORMS_ARRAY, &activeUniforms);
+        mActiveUniforms = *(sh::ActiveUniforms*)activeUniforms;
     }
     else
     {
diff --git a/src/libGLESv2/Shader.h b/src/libGLESv2/Shader.h
index b73fc28..e2719bb 100644
--- a/src/libGLESv2/Shader.h
+++ b/src/libGLESv2/Shader.h
@@ -19,6 +19,7 @@
 #include <vector>
 
 #include "libGLESv2/ResourceManager.h"
+#include "compiler/Uniform.h"
 
 namespace gl
 {
@@ -60,6 +61,7 @@
     void getSource(GLsizei bufSize, GLsizei *length, char *buffer);
     int getTranslatedSourceLength() const;
     void getTranslatedSource(GLsizei bufSize, GLsizei *length, char *buffer);
+    const sh::ActiveUniforms &getUniforms();
 
     virtual void compile() = 0;
     virtual void uncompile();
@@ -106,6 +108,7 @@
     char *mSource;
     char *mHlsl;
     char *mInfoLog;
+    sh::ActiveUniforms mActiveUniforms;
 
     ResourceManager *mResourceManager;
 };