HLSL: Handle "." for structure dereference and swizzle.

This commit is contained in:
John Kessenich
2016-06-17 17:16:27 -06:00
parent 5aa59e2044
commit 93a162a857
6 changed files with 200 additions and 45 deletions

View File

@@ -1097,8 +1097,16 @@ bool HlslGrammar::acceptPostfixExpression(TIntermTyped*& node)
// We have a valid post-unary operator, process it.
switch (postOp) {
case EOpIndexDirectStruct:
// todo
{
// includes swizzles
HlslToken field;
if (! acceptIdentifier(field)) {
expected("swizzle or member");
return false;
}
node = parseContext.handleDotDereference(field.loc, node, *field.string);
break;
}
case EOpIndexIndirect:
{
TIntermTyped* indexNode = nullptr;