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:
@@ -437,7 +437,7 @@ nir_store_deref_var(nir_builder *build, nir_deref_var *deref,
|
||||
nir_intrinsic_instr_create(build->shader, nir_intrinsic_store_var);
|
||||
store->num_components = num_components;
|
||||
store->const_index[0] = writemask & ((1 << num_components) - 1);
|
||||
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(value);
|
||||
nir_builder_instr_insert(build, &store->instr);
|
||||
}
|
||||
@@ -450,8 +450,8 @@ nir_copy_deref_var(nir_builder *build, nir_deref_var *dest, nir_deref_var *src)
|
||||
|
||||
nir_intrinsic_instr *copy =
|
||||
nir_intrinsic_instr_create(build->shader, nir_intrinsic_copy_var);
|
||||
copy->variables[0] = nir_deref_as_var(nir_copy_deref(copy, &dest->deref));
|
||||
copy->variables[1] = nir_deref_as_var(nir_copy_deref(copy, &src->deref));
|
||||
copy->variables[0] = nir_deref_var_clone(dest, copy);
|
||||
copy->variables[1] = nir_deref_var_clone(src, copy);
|
||||
nir_builder_instr_insert(build, ©->instr);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user