Commit acdd70f4 by Jamie Madill Committed by Shannon Woods

Fix nested uniforms in interface blocks to have the proper API-visible names.

TRAC #22856 Signed-off-by: Geoff Lang Signed-off-by: Shannon Woods Authored-by: Jamie Madill
parent 52660ffc
...@@ -2398,6 +2398,7 @@ void ProgramBinary::defineUniformBlockMembers(const sh::ActiveUniforms &uniforms ...@@ -2398,6 +2398,7 @@ void ProgramBinary::defineUniformBlockMembers(const sh::ActiveUniforms &uniforms
for (unsigned int uniformIndex = 0; uniformIndex < uniforms.size(); uniformIndex++) for (unsigned int uniformIndex = 0; uniformIndex < uniforms.size(); uniformIndex++)
{ {
const sh::Uniform &uniform = uniforms[uniformIndex]; const sh::Uniform &uniform = uniforms[uniformIndex];
const std::string &uniformName = (prefix.empty() ? uniform.name : prefix + "." + uniform.name);
if (!uniform.fields.empty()) if (!uniform.fields.empty())
{ {
...@@ -2405,18 +2406,17 @@ void ProgramBinary::defineUniformBlockMembers(const sh::ActiveUniforms &uniforms ...@@ -2405,18 +2406,17 @@ void ProgramBinary::defineUniformBlockMembers(const sh::ActiveUniforms &uniforms
{ {
for (unsigned int arrayElement = 0; arrayElement < uniform.arraySize; arrayElement++) for (unsigned int arrayElement = 0; arrayElement < uniform.arraySize; arrayElement++)
{ {
const std::string uniformElementName = uniform.name + arrayString(arrayElement); const std::string uniformElementName = uniformName + arrayString(arrayElement);
defineUniformBlockMembers(uniform.fields, uniformElementName, blockIndex, blockInfoItr, blockUniformIndexes); defineUniformBlockMembers(uniform.fields, uniformElementName, blockIndex, blockInfoItr, blockUniformIndexes);
} }
} }
else else
{ {
defineUniformBlockMembers(uniform.fields, uniform.name, blockIndex, blockInfoItr, blockUniformIndexes); defineUniformBlockMembers(uniform.fields, uniformName, blockIndex, blockInfoItr, blockUniformIndexes);
} }
} }
else else
{ {
const std::string &uniformName = (prefix.empty() ? uniform.name : prefix + "." + uniform.name);
Uniform *newUniform = new Uniform(uniform.type, uniform.precision, uniformName, uniform.arraySize, Uniform *newUniform = new Uniform(uniform.type, uniform.precision, uniformName, uniform.arraySize,
blockIndex, **blockInfoItr); blockIndex, **blockInfoItr);
......
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