Explicitly pass the constant tables to the defineUniform function

Trac #22155 Signed-off-by: Geoff Lang Signed-off-by: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1500 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent d2fb490e
...@@ -2066,7 +2066,7 @@ bool ProgramBinary::linkUniforms(InfoLog &infoLog, GLenum shader, D3DConstantTab ...@@ -2066,7 +2066,7 @@ bool ProgramBinary::linkUniforms(InfoLog &infoLog, GLenum shader, D3DConstantTab
{ {
const D3DConstant *constant = constantTable->getConstant(constantIndex); const D3DConstant *constant = constantTable->getConstant(constantIndex);
if (!defineUniform(infoLog, shader, constant, "")) if (!defineUniform(infoLog, shader, constant, "", mConstantTableVS, mConstantTablePS))
{ {
return false; return false;
} }
...@@ -2077,14 +2077,15 @@ bool ProgramBinary::linkUniforms(InfoLog &infoLog, GLenum shader, D3DConstantTab ...@@ -2077,14 +2077,15 @@ bool ProgramBinary::linkUniforms(InfoLog &infoLog, GLenum shader, D3DConstantTab
// Adds the description of a constant found in the binary shader to the list of uniforms // Adds the description of a constant found in the binary shader to the list of uniforms
// Returns true if succesful (uniform not already defined) // Returns true if succesful (uniform not already defined)
bool ProgramBinary::defineUniform(InfoLog &infoLog, GLenum shader, const D3DConstant *constant, const std::string &name) bool ProgramBinary::defineUniform(InfoLog &infoLog, GLenum shader, const D3DConstant *constant, const std::string &name,
D3DConstantTable *vsConstantTable, D3DConstantTable *psConstantTable)
{ {
if (constant->registerSet == D3DConstant::RS_SAMPLER) if (constant->registerSet == D3DConstant::RS_SAMPLER)
{ {
for (unsigned int i = 0; i < constant->registerCount; i++) for (unsigned int i = 0; i < constant->registerCount; i++)
{ {
const D3DConstant *psConstant = mConstantTablePS->getConstantByName(constant->name.c_str()); const D3DConstant *psConstant = psConstantTable->getConstantByName(constant->name.c_str());
const D3DConstant *vsConstant = mConstantTableVS->getConstantByName(constant->name.c_str()); const D3DConstant *vsConstant = vsConstantTable->getConstantByName(constant->name.c_str());
if (psConstant) if (psConstant)
{ {
...@@ -2136,7 +2137,7 @@ bool ProgramBinary::defineUniform(InfoLog &infoLog, GLenum shader, const D3DCons ...@@ -2136,7 +2137,7 @@ bool ProgramBinary::defineUniform(InfoLog &infoLog, GLenum shader, const D3DCons
std::string structIndex = (constant->elements > 1) ? ("[" + str(arrayIndex) + "]") : ""; std::string structIndex = (constant->elements > 1) ? ("[" + str(arrayIndex) + "]") : "";
if (!defineUniform(infoLog, shader, fieldConstant, name + constant->name + structIndex + ".")) if (!defineUniform(infoLog, shader, fieldConstant, name + constant->name + structIndex + ".", vsConstantTable, psConstantTable))
{ {
return false; return false;
} }
......
...@@ -174,7 +174,8 @@ class ProgramBinary : public RefCountObject ...@@ -174,7 +174,8 @@ class ProgramBinary : public RefCountObject
bool linkAttributes(InfoLog &infoLog, const AttributeBindings &attributeBindings, FragmentShader *fragmentShader, VertexShader *vertexShader); bool linkAttributes(InfoLog &infoLog, const AttributeBindings &attributeBindings, FragmentShader *fragmentShader, VertexShader *vertexShader);
bool linkUniforms(InfoLog &infoLog, GLenum shader, D3DConstantTable *constantTable); bool linkUniforms(InfoLog &infoLog, GLenum shader, D3DConstantTable *constantTable);
bool defineUniform(InfoLog &infoLog, GLenum shader, const D3DConstant *constant, const std::string &name); bool defineUniform(InfoLog &infoLog, GLenum shader, const D3DConstant *constant, const std::string &name,
D3DConstantTable *vsConstantTable, D3DConstantTable *psConstantTable);
bool defineUniform(GLenum shader, const D3DConstant *constant, const std::string &name); bool defineUniform(GLenum shader, const D3DConstant *constant, const std::string &name);
Uniform *createUniform( const D3DConstant *constant, const std::string &name); Uniform *createUniform( const D3DConstant *constant, const std::string &name);
bool applyUniformnfv(Uniform *targetUniform, const GLfloat *v); bool applyUniformnfv(Uniform *targetUniform, const GLfloat *v);
......
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