diff options
author | Kenneth Graunke <[email protected]> | 2013-09-03 16:37:39 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2013-09-09 11:52:22 -0700 |
commit | eff2ca1ac3f77da81a698b08c46f245b28930ede (patch) | |
tree | 44b016fe7775a7dc0583fc1647dee3ea21647e78 /src/glsl/ir_builder.cpp | |
parent | 7f0f60cd840fc88f01b8f6e46cad36c36709d813 (diff) |
glsl: Add IR builder support for triops.
Now that we have the ir_expression constructor that does type inference,
this is trivial to do.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Reviewed-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/glsl/ir_builder.cpp')
-rw-r--r-- | src/glsl/ir_builder.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/glsl/ir_builder.cpp b/src/glsl/ir_builder.cpp index 7d9cf5e4725..87f57901bec 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); |