diff options
author | Kenneth Graunke <[email protected]> | 2010-06-25 13:44:09 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2010-06-28 11:14:47 -0700 |
commit | 5f3fe44595e53874908d1f047405d27861f1df0f (patch) | |
tree | f706f5b0b888f42d6a599d495745255cb9ce6991 /src/glsl | |
parent | a815f7fb83b1117e957c097044f36eae3a6851fb (diff) |
Use a more sensible context in copy propagation.
Diffstat (limited to 'src/glsl')
-rw-r--r-- | src/glsl/ir_copy_propagation.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/glsl/ir_copy_propagation.cpp b/src/glsl/ir_copy_propagation.cpp index 46ef6679d9f..a02852ed0cc 100644 --- a/src/glsl/ir_copy_propagation.cpp +++ b/src/glsl/ir_copy_propagation.cpp @@ -195,9 +195,8 @@ kill_invalidated_copies(ir_assignment *ir, exec_list *acp) * of a variable to a variable. */ static void -add_copy(ir_assignment *ir, exec_list *acp) +add_copy(void *ctx, ir_assignment *ir, exec_list *acp) { - void *ctx = talloc_parent(ir); acp_entry *entry; if (ir->condition) { @@ -226,6 +225,7 @@ copy_propagation_basic_block(ir_instruction *first, bool *out_progress = (bool *)data; bool progress = false; + void *ctx = talloc(NULL, void*); for (ir = first;; ir = (ir_instruction *)ir->next) { ir_assignment *ir_assign = ir->as_assignment(); @@ -234,12 +234,13 @@ copy_propagation_basic_block(ir_instruction *first, if (ir_assign) { kill_invalidated_copies(ir_assign, &acp); - add_copy(ir_assign, &acp); + add_copy(ctx, ir_assign, &acp); } if (ir == last) break; } *out_progress = progress; + talloc_free(ctx); } /** |