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) ...@@ -174,6 +174,11 @@ void Shader::getTranslatedSource(GLsizei bufSize, GLsizei *length, char *buffer)
getSourceImpl(mHlsl, bufSize, length, buffer); getSourceImpl(mHlsl, bufSize, length, buffer);
} }
const sh::ActiveUniforms &Shader::getUniforms()
{
return mActiveUniforms;
}
bool Shader::isCompiled() bool Shader::isCompiled()
{ {
return mHlsl != NULL; return mHlsl != NULL;
...@@ -310,6 +315,8 @@ void Shader::uncompile() ...@@ -310,6 +315,8 @@ void Shader::uncompile()
mUsesFrontFacing = false; mUsesFrontFacing = false;
mUsesPointSize = false; mUsesPointSize = false;
mUsesPointCoord = false; mUsesPointCoord = false;
mActiveUniforms.clear();
} }
void Shader::compileToHLSL(void *compiler) void Shader::compileToHLSL(void *compiler)
...@@ -355,6 +362,10 @@ void Shader::compileToHLSL(void *compiler) ...@@ -355,6 +362,10 @@ void Shader::compileToHLSL(void *compiler)
ShGetInfo(compiler, SH_OBJECT_CODE_LENGTH, &objCodeLen); ShGetInfo(compiler, SH_OBJECT_CODE_LENGTH, &objCodeLen);
mHlsl = new char[objCodeLen]; mHlsl = new char[objCodeLen];
ShGetObjectCode(compiler, mHlsl); ShGetObjectCode(compiler, mHlsl);
void *activeUniforms;
ShGetInfoPointer(compiler, SH_ACTIVE_UNIFORMS_ARRAY, &activeUniforms);
mActiveUniforms = *(sh::ActiveUniforms*)activeUniforms;
} }
else else
{ {
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <vector> #include <vector>
#include "libGLESv2/ResourceManager.h" #include "libGLESv2/ResourceManager.h"
#include "compiler/Uniform.h"
namespace gl namespace gl
{ {
...@@ -60,6 +61,7 @@ class Shader ...@@ -60,6 +61,7 @@ class Shader
void getSource(GLsizei bufSize, GLsizei *length, char *buffer); void getSource(GLsizei bufSize, GLsizei *length, char *buffer);
int getTranslatedSourceLength() const; int getTranslatedSourceLength() const;
void getTranslatedSource(GLsizei bufSize, GLsizei *length, char *buffer); void getTranslatedSource(GLsizei bufSize, GLsizei *length, char *buffer);
const sh::ActiveUniforms &getUniforms();
virtual void compile() = 0; virtual void compile() = 0;
virtual void uncompile(); virtual void uncompile();
...@@ -106,6 +108,7 @@ class Shader ...@@ -106,6 +108,7 @@ class Shader
char *mSource; char *mSource;
char *mHlsl; char *mHlsl;
char *mInfoLog; char *mInfoLog;
sh::ActiveUniforms mActiveUniforms;
ResourceManager *mResourceManager; 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