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
parent 043da138
......@@ -174,6 +174,11 @@ void Shader::getTranslatedSource(GLsizei bufSize, GLsizei *length, char *buffer)
getSourceImpl(mHlsl, bufSize, length, buffer);
}
const sh::ActiveUniforms &Shader::getUniforms()
{
return mActiveUniforms;
}
bool Shader::isCompiled()
{
return mHlsl != NULL;
......@@ -310,6 +315,8 @@ void Shader::uncompile()
mUsesFrontFacing = false;
mUsesPointSize = false;
mUsesPointCoord = false;
mActiveUniforms.clear();
}
void Shader::compileToHLSL(void *compiler)
......@@ -355,6 +362,10 @@ void Shader::compileToHLSL(void *compiler)
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
{
......
......@@ -19,6 +19,7 @@
#include <vector>
#include "libGLESv2/ResourceManager.h"
#include "compiler/Uniform.h"
namespace gl
{
......@@ -60,6 +61,7 @@ class Shader
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 @@ class Shader
char *mSource;
char *mHlsl;
char *mInfoLog;
sh::ActiveUniforms mActiveUniforms;
ResourceManager *mResourceManager;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment