summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-12-24 11:03:01 -0800
committerJason Ekstrand <[email protected]>2016-12-30 12:38:04 -0800
commit8495ece52ee06f8bc94773678fa610c5939a3baa (patch)
tree681d211a10c83e992ad6432423cf8590bb7a3473
parentffa4ba71d91396f7323affedb21618d183a28443 (diff)
nir/split_var_copies: Use a nir_shader rather than a void *mem_ctx
Reviewed-by: Eduardo Lima Mitev <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
-rw-r--r--src/compiler/nir/nir_split_var_copies.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/nir/nir_split_var_copies.c b/src/compiler/nir/nir_split_var_copies.c
index cfebb0bb948..94a45ee26a6 100644
--- a/src/compiler/nir/nir_split_var_copies.c
+++ b/src/compiler/nir/nir_split_var_copies.c
@@ -62,7 +62,7 @@
*/
struct split_var_copies_state {
- void *mem_ctx;
+ nir_shader *shader;
void *dead_ctx;
bool progress;
};
@@ -176,7 +176,7 @@ split_var_copy_instr(nir_intrinsic_instr *old_copy,
* actually add the new copy instruction.
*/
nir_intrinsic_instr *new_copy =
- nir_intrinsic_instr_create(state->mem_ctx, nir_intrinsic_copy_var);
+ nir_intrinsic_instr_create(state->shader, nir_intrinsic_copy_var);
/* We need to make copies because a) this deref chain actually
* belongs to the copy instruction and b) the deref chains may
@@ -254,7 +254,7 @@ split_var_copies_impl(nir_function_impl *impl)
{
struct split_var_copies_state state;
- state.mem_ctx = ralloc_parent(impl);
+ state.shader = impl->function->shader;
state.dead_ctx = ralloc_context(NULL);
state.progress = false;