nir/opt_varyings: fix alu def cloning

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 <jnoorman@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Fixes: c66967b5cb ("nir: add nir_opt_varyings, new pass optimizing and compacting varyings")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40651>
This commit is contained in:
Job Noorman 2026-04-03 08:18:08 +02:00
parent d56d35aa76
commit 273fd18b89

View file

@ -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;