diff options
author | Jason Ekstrand <[email protected]> | 2020-04-17 09:52:25 -0500 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-04-17 19:21:44 +0000 |
commit | acaccff4d331ecc4b2794fef3f4b117abdd15abf (patch) | |
tree | a8d90210a61787a324e17fa40284c763fd6ede05 /src/compiler | |
parent | 4b160c67764b3f0d0a843f7542d6079aa3a7d8f2 (diff) |
nir/builder: Handle any bit-size selector in nir_extract
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')
-rw-r--r-- | src/compiler/nir/nir_builder.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h index 69c7d312b84..481ea6382bf 100644 --- a/src/compiler/nir/nir_builder.h +++ b/src/compiler/nir/nir_builder.h @@ -580,7 +580,7 @@ _nir_vector_extract_helper(nir_builder *b, nir_ssa_def *vec, nir_ssa_def *c, return nir_channel(b, vec, start); } else { unsigned mid = start + (end - start) / 2; - return nir_bcsel(b, nir_ilt(b, c, nir_imm_int(b, mid)), + return nir_bcsel(b, nir_ilt(b, c, nir_imm_intN_t(b, mid, c->bit_size)), _nir_vector_extract_helper(b, vec, c, start, mid), _nir_vector_extract_helper(b, vec, c, mid, end)); } @@ -591,7 +591,7 @@ nir_vector_extract(nir_builder *b, nir_ssa_def *vec, nir_ssa_def *c) { nir_src c_src = nir_src_for_ssa(c); if (nir_src_is_const(c_src)) { - unsigned c_const = nir_src_as_uint(c_src); + uint64_t c_const = nir_src_as_uint(c_src); if (c_const < vec->num_components) return nir_channel(b, vec, c_const); else |