From 273fd18b89fe97dd5adff12cf229dfa7e804cb96 Mon Sep 17 00:00:00 2001 From: Job Noorman Date: Fri, 3 Apr 2026 08:18:08 +0200 Subject: [PATCH] nir/opt_varyings: fix alu def cloning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nir_builder_alu_instr_finish_and_insert initialized the def's bit_size and num_components so we should set them afterwards. Signed-off-by: Job Noorman Reviewed-by: Marek Olšák Reviewed-by: Emma Anholt Fixes: c66967b5cb7 ("nir: add nir_opt_varyings, new pass optimizing and compacting varyings") Part-of: --- src/compiler/nir/nir_opt_varyings.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/nir/nir_opt_varyings.c b/src/compiler/nir/nir_opt_varyings.c index 07b2f565600..58a44712d10 100644 --- a/src/compiler/nir/nir_opt_varyings.c +++ b/src/compiler/nir/nir_opt_varyings.c @@ -2241,11 +2241,11 @@ clone_ssa_impl(struct linkage_info *linkage, nir_builder *b, nir_def *ssa) NIR_MAX_VEC_COMPONENTS); } + clone = nir_builder_alu_instr_finish_and_insert(b, alu_clone); + alu_clone->def.num_components = alu->def.num_components; alu_clone->def.bit_size = alu->def.bit_size; - clone = nir_builder_alu_instr_finish_and_insert(b, alu_clone); - /* nir_builder_alu_instr_finish_and_insert overwrites fp_math_ctrl. */ alu_clone->fp_math_ctrl = alu->fp_math_ctrl; alu_clone->no_signed_wrap = alu->no_signed_wrap;