summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_builder.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2012-03-19 16:37:23 -0700
committerEric Anholt <[email protected]>2012-04-13 17:01:20 -0700
commit8bb0091e6838aeee2a5819850c334fde71b5a439 (patch)
tree2aa35bf31aff1f780a002efaaf3a7b4c4f9020af /src/glsl/ir_builder.cpp
parentd32780d5041a6d241834fe565739104f86300425 (diff)
glsl: Add a helper for generating temporary variables in ir_builder.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ir_builder.cpp')
-rw-r--r--src/glsl/ir_builder.cpp11
1 files changed, 11 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)
{