Add support for arrays of aggregates (aka structs) in uniform blocks.

TRAC #23018 Signed-off-by: Geoff Lang Signed-off-by: Nicolas Capens Author: Jamie Madill git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2388 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 70961b33
......@@ -92,7 +92,17 @@ bool InterfaceBlock::getBlockLayoutInfo(const sh::Uniform &uniform, unsigned int
{
if (!uniform.fields.empty())
{
getBlockLayoutInfo(uniform.fields, currentOffset);
if (uniform.arraySize > 0)
{
for (unsigned int arrayElement = 0; arrayElement < uniform.arraySize; arrayElement++)
{
getBlockLayoutInfo(uniform.fields, currentOffset);
}
}
else
{
getBlockLayoutInfo(uniform.fields, currentOffset);
}
return false;
}
......
......@@ -2370,7 +2370,18 @@ void ProgramBinary::defineUniformBlockMembers(const sh::ActiveUniforms &uniforms
if (!uniform.fields.empty())
{
defineUniformBlockMembers(uniform.fields, uniform.name, blockIndex, blockInfoItr, blockUniformIndexes);
if (uniform.arraySize > 0)
{
for (unsigned int arrayElement = 0; arrayElement < uniform.arraySize; arrayElement++)
{
const std::string uniformElementName = uniform.name + "[" + str(arrayElement) + "]";
defineUniformBlockMembers(uniform.fields, uniformElementName, blockIndex, blockInfoItr, blockUniformIndexes);
}
}
else
{
defineUniformBlockMembers(uniform.fields, uniform.name, blockIndex, blockInfoItr, blockUniformIndexes);
}
}
else
{
......
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