diff options
author | Jason Ekstrand <[email protected]> | 2020-04-09 17:03:37 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-17 19:21:44 +0000 |
commit | feca4396974feb0e94603151eaebb6a7a6a22ce3 (patch) | |
tree | fa9cf990c7a7beaa1041b2ce22a8769fe9176297 /src/compiler/spirv/vtn_variables.c | |
parent | acaccff4d331ecc4b2794fef3f4b117abdd15abf (diff) |
spirv: Call nir_builder directly for vector_extract
The nir_builder helper already handles checking if the component
selector is an immediate and returns an undef in the OOB case.
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 | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index 1bb48642b3f..8bb00a5dd40 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -735,11 +735,7 @@ vtn_local_load(struct vtn_builder *b, nir_deref_instr *src, if (src_tail != src) { val->type = src->type; - if (nir_src_is_const(src->arr.index)) - val->def = vtn_vector_extract(b, val->def, - nir_src_as_uint(src->arr.index)); - else - val->def = vtn_vector_extract_dynamic(b, val->def, src->arr.index.ssa); + val->def = nir_vector_extract(&b->nb, val->def, src->arr.index.ssa); } return val; |