HLSL: phase 2b: add l-value operator[] for RWTexture/RWBuffer
This commit adds l-value support for RW texture and buffer objects. Supported are: - pre and post inc/decrement - function out parameters - op-assignments, such as *=, +-, etc. - result values from op-assignments. e.g, val=(MyRwTex[loc] *= 2); Not supported are: - Function inout parameters - multiple post-inc/decrement operators. E.g, MyRWTex[loc]++++;
This commit is contained in:
@@ -1783,6 +1783,8 @@ bool HlslGrammar::acceptAssignmentExpression(TIntermTyped*& node)
|
||||
}
|
||||
|
||||
node = parseContext.handleAssign(loc, assignOp, node, rightNode);
|
||||
node = parseContext.handleLvalue(loc, "assign", node);
|
||||
|
||||
if (node == nullptr) {
|
||||
parseContext.error(loc, "could not create assignment", "", "");
|
||||
return false;
|
||||
@@ -1946,6 +1948,7 @@ bool HlslGrammar::acceptUnaryExpression(TIntermTyped*& node)
|
||||
return true;
|
||||
|
||||
node = intermediate.addUnaryMath(unaryOp, node, loc);
|
||||
node = parseContext.handleLvalue(loc, "", node);
|
||||
|
||||
return node != nullptr;
|
||||
}
|
||||
@@ -2061,6 +2064,7 @@ bool HlslGrammar::acceptPostfixExpression(TIntermTyped*& node)
|
||||
case EOpPostDecrement:
|
||||
// DEC_OP
|
||||
node = intermediate.addUnaryMath(postOp, node, loc);
|
||||
node = parseContext.handleLvalue(loc, "", node);
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
|
||||
Reference in New Issue
Block a user