nir/fold_16bit_sampler_conversions: Fix dest type mismatches.

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5996
Fixes: fb29cef8dd ("nir: add many passes that lower and optimize 16-bit input/outputs and samplers")
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14895>
This commit is contained in:
Georg Lehmann 2022-02-05 23:03:32 +01:00 committed by Marge Bot
parent 798e47be51
commit 88ec73e5e8

View file

@ -517,8 +517,9 @@ nir_fold_16bit_sampler_conversions(nir_shader *nir,
}
/* Optimize the destination. */
bool is_f32_to_f16 = true;
bool is_i32_to_i16 = true; /* same behavior for int and uint */
bool is_f32_to_f16 = tex->dest_type & nir_type_float;
/* same behavior for int and uint */
bool is_i32_to_i16 = tex->dest_type & (nir_type_int | nir_type_uint);
nir_foreach_use(use, &tex->dest.ssa) {
is_f32_to_f16 &= is_f32_to_f16_conversion(use->parent_instr);