From 8273bd46877e2ea2b8a02b87a11c68102d07e1f2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 4 Aug 2010 12:34:56 -0700 Subject: 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. --- src/glsl/link_functions.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/glsl/link_functions.cpp') diff --git a/src/glsl/link_functions.cpp b/src/glsl/link_functions.cpp index fdf886f662..dfda05fcbe 100644 --- a/src/glsl/link_functions.cpp +++ b/src/glsl/link_functions.cpp @@ -143,7 +143,7 @@ public: const ir_instruction *const original = (ir_instruction *) node; assert(const_cast(original)->as_variable()); - ir_instruction *copy = original->clone(ht); + ir_instruction *copy = original->clone(linked, ht); formal_parameters.push_tail(copy); } @@ -152,7 +152,7 @@ public: foreach_list_const(node, &sig->body) { const ir_instruction *const original = (ir_instruction *) node; - ir_instruction *copy = original->clone(ht); + ir_instruction *copy = original->clone(linked, ht); linked_sig->body.push_tail(copy); } @@ -182,7 +182,7 @@ public: /* Clone the ir_variable that the dereference already has and add * it to the linked shader. */ - var = ir->var->clone(NULL); + var = ir->var->clone(linked, NULL); linked->symbols->add_variable(var->name, var); linked->ir->push_head(var); } -- cgit v1.2.3