diff options
Diffstat (limited to 'src/glsl/ir_builder.h')
-rw-r--r-- | src/glsl/ir_builder.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/glsl/ir_builder.h b/src/glsl/ir_builder.h index 350f9a33a81..af9d1600f68 100644 --- a/src/glsl/ir_builder.h +++ b/src/glsl/ir_builder.h @@ -50,6 +50,27 @@ public: ir_rvalue *val; }; +/** Automatic generator for ir_dereference_variable on assignment LHS. + * + * \sa operand + */ +class deref { +public: + deref(ir_dereference *val) + : val(val) + { + } + + deref(ir_variable *var) + { + void *mem_ctx = ralloc_parent(var); + val = new(mem_ctx) ir_dereference_variable(var); + } + + + ir_dereference *val; +}; + class ir_factory { public: void emit(ir_instruction *ir); @@ -58,6 +79,9 @@ public: void *mem_ctx; }; +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, operand b); ir_expression *add(operand a, operand b); ir_expression *sub(operand a, operand b); |