spirv,nir: Move the SPIR-V vector insert code to NIR
This also makes spirv_to_nir a bit simpler because the new nir_vector_insert helper automatically handles a constant component selector like nir_vector_extract does. Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4495>
This commit is contained in:

committed by
Marge Bot

parent
feca439697
commit
f5deed138a
@@ -751,12 +751,8 @@ vtn_local_store(struct vtn_builder *b, struct vtn_ssa_value *src,
|
||||
struct vtn_ssa_value *val = vtn_create_ssa_value(b, dest_tail->type);
|
||||
_vtn_local_load_store(b, true, dest_tail, val, access);
|
||||
|
||||
if (nir_src_is_const(dest->arr.index))
|
||||
val->def = vtn_vector_insert(b, val->def, src->def,
|
||||
nir_src_as_uint(dest->arr.index));
|
||||
else
|
||||
val->def = vtn_vector_insert_dynamic(b, val->def, src->def,
|
||||
dest->arr.index.ssa);
|
||||
val->def = nir_vector_insert(&b->nb, val->def, src->def,
|
||||
dest->arr.index.ssa);
|
||||
_vtn_local_load_store(b, false, dest_tail, val, access);
|
||||
} else {
|
||||
_vtn_local_load_store(b, false, dest_tail, src, access);
|
||||
|
Reference in New Issue
Block a user