From 134a5ad31c8d39219f241f7a7cad246a6864c74b Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Sat, 24 Dec 2016 09:42:34 -0800 Subject: nir: Make nir_copy_deref follow the "clone" pattern We rename it to nir_deref_clone, re-order the sources to match the other clone functions, and expose nir_deref_var_clone. This past part, in particular, lets us get rid of quite a few lines since we no longer have to call nir_copy_deref and wrap it in deref_as_var. Reviewed-by: Jordan Justen --- src/compiler/nir/nir_lower_indirect_derefs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/compiler/nir/nir_lower_indirect_derefs.c') diff --git a/src/compiler/nir/nir_lower_indirect_derefs.c b/src/compiler/nir/nir_lower_indirect_derefs.c index 5c97dc8e5fe..09cc9a310b1 100644 --- a/src/compiler/nir/nir_lower_indirect_derefs.c +++ b/src/compiler/nir/nir_lower_indirect_derefs.c @@ -122,8 +122,7 @@ emit_load_store(nir_builder *b, nir_intrinsic_instr *orig_instr, nir_intrinsic_instr *load = nir_intrinsic_instr_create(b->shader, nir_intrinsic_load_var); load->num_components = orig_instr->num_components; - load->variables[0] = - nir_deref_as_var(nir_copy_deref(load, &deref->deref)); + load->variables[0] = nir_deref_var_clone(deref, load); unsigned bit_size = orig_instr->dest.ssa.bit_size; nir_ssa_dest_init(&load->instr, &load->dest, load->num_components, bit_size, NULL); @@ -135,8 +134,7 @@ emit_load_store(nir_builder *b, nir_intrinsic_instr *orig_instr, nir_intrinsic_instr_create(b->shader, nir_intrinsic_store_var); store->num_components = orig_instr->num_components; nir_intrinsic_set_write_mask(store, nir_intrinsic_write_mask(orig_instr)); - store->variables[0] = - nir_deref_as_var(nir_copy_deref(store, &deref->deref)); + store->variables[0] = nir_deref_var_clone(deref, store); store->src[0] = nir_src_for_ssa(src); nir_builder_instr_insert(b, &store->instr); } -- cgit v1.2.3