diff options
author | Eric Anholt <[email protected]> | 2010-08-04 12:34:56 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2010-08-04 12:42:47 -0700 |
commit | 8273bd46877e2ea2b8a02b87a11c68102d07e1f2 (patch) | |
tree | 3182808d4b54aa9c094a5e41bcda1405244b8e0b /src/glsl/link_functions.cpp | |
parent | 84ee01f40acf88185484df386b7715034e7685c9 (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/link_functions.cpp')
-rw-r--r-- | src/glsl/link_functions.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/glsl/link_functions.cpp b/src/glsl/link_functions.cpp index fdf886f6627..dfda05fcbe5 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<ir_instruction *>(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); } |