summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_builder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/ir_builder.cpp')
-rw-r--r--src/glsl/ir_builder.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/glsl/ir_builder.cpp b/src/glsl/ir_builder.cpp
index 7d9cf5e..87f5790 100644
--- a/src/glsl/ir_builder.cpp
+++ b/src/glsl/ir_builder.cpp
@@ -173,6 +173,14 @@ expr(ir_expression_operation op, operand a, operand b)
return new(mem_ctx) ir_expression(op, a.val, b.val);
}
+ir_expression *
+expr(ir_expression_operation op, operand a, operand b, operand c)
+{
+ void *mem_ctx = ralloc_parent(a.val);
+
+ return new(mem_ctx) ir_expression(op, a.val, b.val, c.val);
+}
+
ir_expression *add(operand a, operand b)
{
return expr(ir_binop_add, a, b);