diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/ir_builder.cpp | 8 | ||||
-rw-r--r-- | src/glsl/ir_builder.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/glsl/ir_builder.cpp b/src/glsl/ir_builder.cpp index 9a16c90e5cd..fc6ee96a331 100644 --- a/src/glsl/ir_builder.cpp +++ b/src/glsl/ir_builder.cpp @@ -143,6 +143,14 @@ swizzle_xyzw(operand a) } ir_expression * +expr(ir_expression_operation op, operand a) +{ + void *mem_ctx = ralloc_parent(a.val); + + return new(mem_ctx) ir_expression(op, a.val); +} + +ir_expression * expr(ir_expression_operation op, operand a, operand b) { void *mem_ctx = ralloc_parent(a.val); diff --git a/src/glsl/ir_builder.h b/src/glsl/ir_builder.h index 0ebcbab95c2..410b08cd052 100644 --- a/src/glsl/ir_builder.h +++ b/src/glsl/ir_builder.h @@ -83,6 +83,7 @@ public: ir_assignment *assign(deref lhs, operand rhs); ir_assignment *assign(deref lhs, operand rhs, int writemask); +ir_expression *expr(ir_expression_operation op, operand a); ir_expression *expr(ir_expression_operation op, operand a, operand b); ir_expression *add(operand a, operand b); ir_expression *sub(operand a, operand b); |