HLSL: Add shape conversions for scalar -> vector assigments.

Also, this allows turning on the error check for a failed assigment
when parsing.

This makes 39 HLSL tests have a working assignment that was previously
silently dropped, due to lack of this functionality.
This commit is contained in:
John Kessenich
2016-07-28 17:53:56 -06:00
parent a26a5170a3
commit fea226ba43
46 changed files with 2571 additions and 1413 deletions

View File

@@ -1605,9 +1605,10 @@ bool HlslGrammar::acceptAssignmentExpression(TIntermTyped*& node)
}
node = intermediate.addAssign(assignOp, node, rightNode, loc);
// TODO: Turn this on after tests are fixed for it:
//if (node == nullptr)
// parseContext.error(loc, "could not create assignment", "", "");
if (node == nullptr) {
parseContext.error(loc, "could not create assignment", "", "");
return false;
}
if (! peekTokenClass(EHTokComma))
return true;
@@ -1692,6 +1693,10 @@ bool HlslGrammar::acceptBinaryExpression(TIntermTyped*& node, PrecedenceLevel pr
}
node = intermediate.addBinaryMath(op, node, rightNode, loc);
if (node == nullptr) {
parseContext.error(loc, "Could not perform requested binary operation", "", "");
return false;
}
if (! peekTokenClass(EHTokComma))
return true;