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 <jordan.l.justen@intel.com>
This commit is contained in:
Jason Ekstrand
2016-12-24 09:42:34 -08:00
parent 832dddcf91
commit 134a5ad31c
13 changed files with 51 additions and 65 deletions

View File

@@ -86,8 +86,7 @@ try_lower_input_load(nir_function_impl *impl, nir_intrinsic_instr *load)
tex->is_array = true;
tex->is_shadow = false;
tex->texture =
nir_deref_as_var(nir_copy_deref(tex, &load->variables[0]->deref));
tex->texture = nir_deref_var_clone(load->variables[0], tex);
tex->sampler = NULL;
tex->texture_index = 0;
tex->sampler_index = 0;