From 0ce2e6594ddb8db70b18f6a52684acb6a4e18e0a Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sun, 7 Jul 2024 15:04:50 -0400 Subject: [PATCH] nir/opt_constant_folding: fix array size define In practice these are equal but the old code was semantically wrong: that dimension is "sources" not "components". Use the correct #define. This came up when reviewing https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29994 Signed-off-by: Alyssa Rosenzweig Reviewed-by: Konstantin Seurer 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 2ff1135c980..2d9b1daa9fc 100644 --- a/src/compiler/nir/nir_opt_constant_folding.c +++ b/src/compiler/nir/nir_opt_constant_folding.c @@ -39,7 +39,7 @@ struct constant_fold_state { static bool try_fold_alu(nir_builder *b, nir_alu_instr *alu) { - nir_const_value src[NIR_MAX_VEC_COMPONENTS][NIR_MAX_VEC_COMPONENTS]; + nir_const_value src[NIR_ALU_MAX_INPUTS][NIR_MAX_VEC_COMPONENTS]; /* In the case that any outputs/inputs have unsized types, then we need to * guess the bit-size. In this case, the validator ensures that all