Allow matrix-in-matrix construction

TRAC #11868 Signed-off-by: Shannon Woods Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@198 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent ea15b0ed
......@@ -467,8 +467,10 @@ bool TParseContext::constructorErrorCheck(int line, TIntermNode* node, TFunction
}
if (matrixInMatrix && !type->isArray()) {
error(line, "constructing matrix from matrix", "constructor", "(reserved)");
return true;
if (function.getParamCount() != 1) {
error(line, "constructing matrix from matrix can only take one argument", "constructor", "");
return true;
}
}
if (overFull) {
......@@ -481,10 +483,12 @@ bool TParseContext::constructorErrorCheck(int line, TIntermNode* node, TFunction
return true;
}
if ((op != EOpConstructStruct && size != 1 && size < type->getObjectSize()) ||
(op == EOpConstructStruct && size < type->getObjectSize())) {
error(line, "not enough data provided for construction", "constructor", "");
return true;
if (!type->isMatrix()) {
if ((op != EOpConstructStruct && size != 1 && size < type->getObjectSize()) ||
(op == EOpConstructStruct && size < type->getObjectSize())) {
error(line, "not enough data provided for construction", "constructor", "");
return true;
}
}
TIntermTyped* typed = node->getAsTyped();
......
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