From 788698383528c3fa3265da476b9dc255353f8bc2 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 7 Apr 2021 19:29:40 +0200 Subject: [PATCH] nir/lower_tex: do not stumble on 16-bit inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Part-of: --- src/compiler/nir/nir_lower_tex.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/nir/nir_lower_tex.c b/src/compiler/nir/nir_lower_tex.c index 1ac838a349d..7af7d9d0f18 100644 --- a/src/compiler/nir/nir_lower_tex.c +++ b/src/compiler/nir/nir_lower_tex.c @@ -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);