glsl2: Make ir_assignment derive from ir_instruction, not ir_rvalue.
Assignments can only exist at the top level instruction stream; the residual value is handled by assigning the value to a temporary and returning an ir_dereference_variable of that temporary.
This commit is contained in:
@@ -506,7 +506,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class ir_assignment : public ir_rvalue {
|
class ir_assignment : public ir_instruction {
|
||||||
public:
|
public:
|
||||||
ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs, ir_rvalue *condition);
|
ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs, ir_rvalue *condition);
|
||||||
|
|
||||||
|
@@ -357,6 +357,8 @@ read_instruction(_mesa_glsl_parse_state *st, s_expression *expr,
|
|||||||
ir_instruction *inst = NULL;
|
ir_instruction *inst = NULL;
|
||||||
if (strcmp(tag->value(), "declare") == 0) {
|
if (strcmp(tag->value(), "declare") == 0) {
|
||||||
inst = read_declaration(st, list);
|
inst = read_declaration(st, list);
|
||||||
|
} else if (strcmp(tag->value(), "assign") == 0) {
|
||||||
|
inst = read_assignment(st, list);
|
||||||
} else if (strcmp(tag->value(), "if") == 0) {
|
} else if (strcmp(tag->value(), "if") == 0) {
|
||||||
inst = read_if(st, list, loop_ctx);
|
inst = read_if(st, list, loop_ctx);
|
||||||
} else if (strcmp(tag->value(), "loop") == 0) {
|
} else if (strcmp(tag->value(), "loop") == 0) {
|
||||||
@@ -546,8 +548,6 @@ read_rvalue(_mesa_glsl_parse_state *st, s_expression *expr)
|
|||||||
return rvalue;
|
return rvalue;
|
||||||
else if (strcmp(tag->value(), "swiz") == 0) {
|
else if (strcmp(tag->value(), "swiz") == 0) {
|
||||||
rvalue = read_swizzle(st, list);
|
rvalue = read_swizzle(st, list);
|
||||||
} else if (strcmp(tag->value(), "assign") == 0) {
|
|
||||||
rvalue = read_assignment(st, list);
|
|
||||||
} else if (strcmp(tag->value(), "expression") == 0) {
|
} else if (strcmp(tag->value(), "expression") == 0) {
|
||||||
rvalue = read_expression(st, list);
|
rvalue = read_expression(st, list);
|
||||||
} else if (strcmp(tag->value(), "call") == 0) {
|
} else if (strcmp(tag->value(), "call") == 0) {
|
||||||
|
Reference in New Issue
Block a user