aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/spirv/vtn_variables.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2020-04-09 17:03:37 -0500
committerMarge Bot <[email protected]>2020-04-17 19:21:44 +0000
commitfeca4396974feb0e94603151eaebb6a7a6a22ce3 (patch)
treefa9cf990c7a7beaa1041b2ce22a8769fe9176297 /src/compiler/spirv/vtn_variables.c
parentacaccff4d331ecc4b2794fef3f4b117abdd15abf (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.c6
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;