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 <alyssa@rosenzweig.io>
Suggested-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30214>
This commit is contained in:
Alyssa Rosenzweig
2024-07-16 11:30:41 -04:00
committed by Marge Bot
parent bda47e29de
commit 9f1d1c4fc8

View File

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