nir: silence a warning in nir_opt_shrink_vectors

gcc assumes the array is a string, so it treats it as having 15 elements
instead of 16.

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36099>
This commit is contained in:
Marek Olšák 2025-01-19 00:03:01 -05:00 committed by Marge Bot
parent b35e8a38e7
commit a15c1e1896

View file

@ -135,7 +135,7 @@ shrink_dest_to_read_mask(nir_def *def, bool shrink_start)
/* Reswizzle sources, which must be ALU since they have swizzle */
assert(first_bit + comps <= NIR_MAX_VEC_COMPONENTS);
uint8_t swizzle[NIR_MAX_VEC_COMPONENTS] = { 0 };
uint8_t swizzle[NIR_MAX_VEC_COMPONENTS + 1] = { 0 };
for (unsigned i = 0; i < comps; ++i) {
swizzle[first_bit + i] = i;
}