diff options
author | Jason Ekstrand <[email protected]> | 2020-04-09 17:09:10 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-17 19:21:44 +0000 |
commit | f5deed138a0b4765438135367248f1d8f0649975 (patch) | |
tree | e3199ba6167bd2a2c6eb329193feba934cb77fe0 /src/compiler/spirv/vtn_variables.c | |
parent | feca4396974feb0e94603151eaebb6a7a6a22ce3 (diff) |
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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4495>
Diffstat (limited to 'src/compiler/spirv/vtn_variables.c')
-rw-r--r-- | src/compiler/spirv/vtn_variables.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index 8bb00a5dd40..9dc2c755ca5 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -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); |