From 798e47be511ade4218158ab36178ed62dd45a47c Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Wed, 23 Mar 2022 11:44:57 +0100 Subject: [PATCH] nir/fold_16bit_sampler_conversions: Don't fold dest upcasts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is not a valid optimization. Fixes: fb29cef8dda ("nir: add many passes that lower and optimize 16-bit input/outputs and samplers") Signed-off-by: Georg Lehmann Reviewed-by: Daniel Schürmann Part-of: --- src/compiler/nir/nir_lower_mediump.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/compiler/nir/nir_lower_mediump.c b/src/compiler/nir/nir_lower_mediump.c index c412d3fcb8c..04823df6642 100644 --- a/src/compiler/nir/nir_lower_mediump.c +++ b/src/compiler/nir/nir_lower_mediump.c @@ -517,22 +517,15 @@ nir_fold_16bit_sampler_conversions(nir_shader *nir, } /* Optimize the destination. */ - bool is_f16_to_f32 = true; bool is_f32_to_f16 = true; - bool is_i16_to_i32 = true; bool is_i32_to_i16 = true; /* same behavior for int and uint */ - bool is_u16_to_u32 = true; nir_foreach_use(use, &tex->dest.ssa) { - is_f16_to_f32 &= is_f16_to_f32_conversion(use->parent_instr); is_f32_to_f16 &= is_f32_to_f16_conversion(use->parent_instr); - is_i16_to_i32 &= is_i16_to_i32_conversion(use->parent_instr); is_i32_to_i16 &= is_i32_to_i16_conversion(use->parent_instr); - is_u16_to_u32 &= is_u16_to_u32_conversion(use->parent_instr); } - if (is_f16_to_f32 || is_f32_to_f16 || is_i16_to_i32 || - is_i32_to_i16 || is_u16_to_u32) { + if (is_f32_to_f16 || is_i32_to_i16) { /* All uses are the same conversions. Replace them with mov. */ nir_foreach_use(use, &tex->dest.ssa) { nir_alu_instr *conv = nir_instr_as_alu(use->parent_instr);