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_amd.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_amd.c')
-rw-r--r-- | src/compiler/spirv/vtn_amd.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/compiler/spirv/vtn_amd.c b/src/compiler/spirv/vtn_amd.c index 55f87c2f98e..195baef9c00 100644 --- a/src/compiler/spirv/vtn_amd.c +++ b/src/compiler/spirv/vtn_amd.c @@ -219,13 +219,8 @@ vtn_handle_amd_shader_explicit_vertex_parameter_instruction(struct vtn_builder * if (vec_array_deref) { assert(vec_deref); - if (nir_src_is_const(vec_deref->arr.index)) { - val->ssa->def = vtn_vector_extract(b, &intrin->dest.ssa, - nir_src_as_uint(vec_deref->arr.index)); - } else { - val->ssa->def = vtn_vector_extract_dynamic(b, &intrin->dest.ssa, - vec_deref->arr.index.ssa); - } + val->ssa->def = nir_vector_extract(&b->nb, &intrin->dest.ssa, + vec_deref->arr.index.ssa); } else { val->ssa->def = &intrin->dest.ssa; } |