diff options
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/ir_builder.cpp | 11 | ||||
-rw-r--r-- | src/glsl/ir_builder.h | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/glsl/ir_builder.cpp b/src/glsl/ir_builder.cpp index 0c8a15bc86e..9a16c90e5cd 100644 --- a/src/glsl/ir_builder.cpp +++ b/src/glsl/ir_builder.cpp @@ -34,6 +34,17 @@ ir_factory::emit(ir_instruction *ir) instructions->push_tail(ir); } +ir_variable * +ir_factory::make_temp(const glsl_type *type, const char *name) +{ + ir_variable *var; + + var = new(mem_ctx) ir_variable(type, name, ir_var_temporary); + emit(var); + + return var; +} + ir_assignment * assign(deref lhs, operand rhs, int writemask) { diff --git a/src/glsl/ir_builder.h b/src/glsl/ir_builder.h index af9d1600f68..0ebcbab95c2 100644 --- a/src/glsl/ir_builder.h +++ b/src/glsl/ir_builder.h @@ -74,6 +74,7 @@ public: class ir_factory { public: void emit(ir_instruction *ir); + ir_variable *make_temp(const glsl_type *type, const char *name); exec_list *instructions; void *mem_ctx; |