aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_function_inlining.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-08-04 12:34:56 -0700
committerEric Anholt <[email protected]>2010-08-04 12:42:47 -0700
commit8273bd46877e2ea2b8a02b87a11c68102d07e1f2 (patch)
tree3182808d4b54aa9c094a5e41bcda1405244b8e0b /src/glsl/ir_function_inlining.cpp
parent84ee01f40acf88185484df386b7715034e7685c9 (diff)
glsl2: Make the clone() method take a talloc context.
In most cases, we needed to be reparenting the cloned IR to a different context (for example, to the linked shader instead of the unlinked shader), or optimization before the reparent would cause memory usage of the original object to grow and grow.
Diffstat (limited to 'src/glsl/ir_function_inlining.cpp')
-rw-r--r--src/glsl/ir_function_inlining.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/glsl/ir_function_inlining.cpp b/src/glsl/ir_function_inlining.cpp
index 95993062435..973813774e2 100644
--- a/src/glsl/ir_function_inlining.cpp
+++ b/src/glsl/ir_function_inlining.cpp
@@ -147,7 +147,7 @@ ir_call::generate_inline(ir_instruction *next_ir)
parameters[i] = NULL;
hash_table_insert(ht, param->variable_referenced(), sig_param);
} else {
- parameters[i] = sig_param->clone(ht);
+ parameters[i] = sig_param->clone(ctx, ht);
parameters[i]->mode = ir_var_auto;
next_ir->insert_before(parameters[i]);
}
@@ -169,7 +169,7 @@ ir_call::generate_inline(ir_instruction *next_ir)
/* Generate the inlined body of the function. */
foreach_iter(exec_list_iterator, iter, callee->body) {
ir_instruction *ir = (ir_instruction *)iter.get();
- ir_instruction *new_ir = ir->clone(ht);
+ ir_instruction *new_ir = ir->clone(ctx, ht);
next_ir->insert_before(new_ir);
visit_tree(new_ir, replace_return_with_assignment, retval);
@@ -190,7 +190,7 @@ ir_call::generate_inline(ir_instruction *next_ir)
sig_param->mode == ir_var_inout)) {
ir_assignment *assign;
- assign = new(ctx) ir_assignment(param->clone(NULL)->as_rvalue(),
+ assign = new(ctx) ir_assignment(param->clone(ctx, NULL)->as_rvalue(),
new(ctx) ir_dereference_variable(parameters[i]),
NULL);
next_ir->insert_before(assign);