Commit ab6fc6a2 by Olli Etuaho

Add support for arrays as function return values in GLSL output

Output the array brackets and the array size correctly when a function's return value type is array. Tested with WebGL 2 test sdk/tests/deqp/data/gles3/shaders/arrays.html BUG=angleproject:971 TEST=WebGL 2 conformance tests Change-Id: I63aa8c54d2696f65351b23acb0749a487298ddfb Reviewed-on: https://chromium-review.googlesource.com/265410Tested-by: 's avatarOlli Etuaho <oetuaho@nvidia.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 4a1858b8
......@@ -777,7 +777,13 @@ bool TOutputGLSLBase::visitAggregate(Visit visit, TIntermAggregate *node)
case EOpPrototype:
// Function declaration.
ASSERT(visit == PreVisit);
writeVariableType(node->getType());
{
const TType &type = node->getType();
writeVariableType(type);
if (type.isArray())
out << arrayBrackets(type);
}
out << " " << hashFunctionName(node->getName());
out << "(";
......@@ -789,7 +795,13 @@ bool TOutputGLSLBase::visitAggregate(Visit visit, TIntermAggregate *node)
case EOpFunction: {
// Function definition.
ASSERT(visit == PreVisit);
writeVariableType(node->getType());
{
const TType &type = node->getType();
writeVariableType(type);
if (type.isArray())
out << arrayBrackets(type);
}
out << " " << hashFunctionName(node->getName());
incrementDepth(node);
......
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