nir/lower_tex: do not stumble on 16-bit inputs

If a has been lowered to float16 here, then we end up trying to
construct a vector of mixed precision, which the validator asserts
about.

So let's make sure we use the same type for all arguments.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10201>
This commit is contained in:
Erik Faye-Lund 2021-04-07 19:29:40 +02:00 committed by Marge Bot
parent bd1b0c3266
commit 7886983835
1 changed files with 3 additions and 3 deletions

View File

@ -324,9 +324,9 @@ convert_yuv_to_rgb(nir_builder *b, nir_tex_instr *tex,
nir_ssa_def *offset =
nir_vec4(b,
nir_imm_float(b, offset_vals[0]),
nir_imm_float(b, offset_vals[1]),
nir_imm_float(b, offset_vals[2]),
nir_imm_floatN_t(b, offset_vals[0], a->bit_size),
nir_imm_floatN_t(b, offset_vals[1], a->bit_size),
nir_imm_floatN_t(b, offset_vals[2], a->bit_size),
a);
offset = nir_f2fN(b, offset, bit_size);