HLSL: Add function call syntax and AST building.

This commit is contained in:
John Kessenich 2016-05-13 09:33:42 -06:00
parent 9db3117e38
commit 4678ca9dac
6 changed files with 83 additions and 25 deletions

View file

@ -754,12 +754,15 @@ TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& l
return paramNodes;
}
void HlslParseContext::handleFunctionArgument(TFunction* function, TIntermAggregate*& arguments, TIntermTyped* arg)
void HlslParseContext::handleFunctionArgument(TFunction* function, TIntermTyped*& arguments, TIntermTyped* newArg)
{
TParameter param = { 0, new TType };
param.type->shallowCopy(arg->getType());
param.type->shallowCopy(newArg->getType());
function->addParameter(param);
arguments = intermediate.growAggregate(arguments, arg);
if (arguments)
arguments = intermediate.growAggregate(arguments, newArg);
else
arguments = newArg;
}
//