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 <alyssa@rosenzweig.io>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30066>
This commit is contained in:
Alyssa Rosenzweig 2024-07-07 15:04:50 -04:00 committed by Marge Bot
parent 24aab6bfaf
commit 0ce2e6594d

View file

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