summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-11-09 14:19:10 -0800
committerIan Romanick <[email protected]>2010-11-19 15:00:25 -0800
commit13f57d42b6929f50d8ef8b4123f46a61c46fde7b (patch)
treed42f595a2bcfecbfa83a9bb2497eed1b4adba9d8 /src/glsl/ir.cpp
parent8e498050dc1a1285c2218fdf4ea506c1cdcd9dd8 (diff)
glsl: Add unary ir_expression constructor
Diffstat (limited to 'src/glsl/ir.cpp')
-rw-r--r--src/glsl/ir.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index 308b7c2010d..1f5e2ebdcb7 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -192,8 +192,21 @@ ir_assignment::ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs,
ir_expression::ir_expression(int op, const struct glsl_type *type,
+ ir_rvalue *op0)
+{
+ assert(get_num_operands(ir_expression_operation(op)) == 1);
+ this->ir_type = ir_type_expression;
+ this->type = type;
+ this->operation = ir_expression_operation(op);
+ this->operands[0] = op0;
+ this->operands[1] = NULL;
+}
+
+ir_expression::ir_expression(int op, const struct glsl_type *type,
ir_rvalue *op0, ir_rvalue *op1)
{
+ assert((op1 == NULL) && (get_num_operands(ir_expression_operation(op)) == 1)
+ || (get_num_operands(ir_expression_operation(op)) == 2));
this->ir_type = ir_type_expression;
this->type = type;
this->operation = ir_expression_operation(op);