Explicitly pass constant tables to linkUniforms

Trac #22155 Signed-off-by: Geoff Lang Signed-off-by: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1501 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 59d9ab14
...@@ -1962,12 +1962,7 @@ bool ProgramBinary::link(InfoLog &infoLog, const AttributeBindings &attributeBin ...@@ -1962,12 +1962,7 @@ bool ProgramBinary::link(InfoLog &infoLog, const AttributeBindings &attributeBin
return false; return false;
} }
if (!linkUniforms(infoLog, GL_FRAGMENT_SHADER, mConstantTablePS)) if (!linkUniforms(infoLog, mConstantTableVS, mConstantTablePS))
{
return false;
}
if (!linkUniforms(infoLog, GL_VERTEX_SHADER, mConstantTableVS))
{ {
return false; return false;
} }
...@@ -2060,18 +2055,27 @@ bool ProgramBinary::linkAttributes(InfoLog &infoLog, const AttributeBindings &at ...@@ -2060,18 +2055,27 @@ bool ProgramBinary::linkAttributes(InfoLog &infoLog, const AttributeBindings &at
return true; return true;
} }
bool ProgramBinary::linkUniforms(InfoLog &infoLog, GLenum shader, D3DConstantTable *constantTable) bool ProgramBinary::linkUniforms(InfoLog &infoLog, D3DConstantTable *vsConstantTable, D3DConstantTable *psConstantTable)
{ {
for (unsigned int constantIndex = 0; constantIndex < constantTable->constants(); constantIndex++) for (unsigned int constantIndex = 0; constantIndex < psConstantTable->constants(); constantIndex++)
{ {
const D3DConstant *constant = constantTable->getConstant(constantIndex); const D3DConstant *constant = psConstantTable->getConstant(constantIndex);
if (!defineUniform(infoLog, shader, constant, "", mConstantTableVS, mConstantTablePS)) if (!defineUniform(infoLog, GL_FRAGMENT_SHADER, constant, "", vsConstantTable, psConstantTable))
{ {
return false; return false;
} }
} }
for (unsigned int constantIndex = 0; constantIndex < vsConstantTable->constants(); constantIndex++)
{
const D3DConstant *constant = vsConstantTable->getConstant(constantIndex);
if (!defineUniform(infoLog, GL_VERTEX_SHADER, constant, "", vsConstantTable, psConstantTable))
{
return false;
}
}
return true; return true;
} }
......
...@@ -173,7 +173,7 @@ class ProgramBinary : public RefCountObject ...@@ -173,7 +173,7 @@ 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, D3DConstantTable *vsConstantTable, D3DConstantTable *psConstantTable);
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); 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);
......
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