From 9f1d1c4fc87add67d35b14a91f5eb7f1c5318682 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 16 Jul 2024 11:30:41 -0400 Subject: [PATCH] nir/opt_constant_folding: fix array size define, pt 2 In practice these are equal but the old code was semantically wrong: that dimension is "sources" not "components". Use the correct #define. Signed-off-by: Alyssa Rosenzweig Suggested-by: Georg Lehmann Reviewed-by: Faith Ekstrand Part-of: --- src/compiler/nir/nir_opt_constant_folding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_opt_constant_folding.c b/src/compiler/nir/nir_opt_constant_folding.c index 2d9b1daa9fc..e1b73554f58 100644 --- a/src/compiler/nir/nir_opt_constant_folding.c +++ b/src/compiler/nir/nir_opt_constant_folding.c @@ -75,7 +75,7 @@ try_fold_alu(nir_builder *b, nir_alu_instr *alu) bit_size = 32; nir_const_value dest[NIR_MAX_VEC_COMPONENTS]; - nir_const_value *srcs[NIR_MAX_VEC_COMPONENTS]; + nir_const_value *srcs[NIR_ALU_MAX_INPUTS]; memset(dest, 0, sizeof(dest)); for (unsigned i = 0; i < nir_op_infos[alu->op].num_inputs; ++i) srcs[i] = src[i];