nir/opt_shrink_vectors: Round to supported vec size
authorAlyssa Rosenzweig <alyssa@collabora.com>
Wed, 22 Jun 2022 19:58:16 +0000 (15:58 -0400)
committerMarge Bot <emma+marge@anholt.net>
Sun, 10 Jul 2022 18:03:46 +0000 (18:03 +0000)
commitbefc68ec3343943cc98963e8dceaa28403747228
tree0f5d51c6ad9e3f41347ba88674ea61141a72806e
parent21b3a234048a270e7999f8e70e25091c599dd3eb
nir/opt_shrink_vectors: Round to supported vec size

The set of supported vector sizes in NIR has holes in it. For example, we
support vec5 and vec8, but not vec6 or vec7. However, this pass did not take
that into account, and would happily shrink a vec8 down to a vec7, causing NIR
validation to fail. Instead, the pass should round up to the next supported
vector size.

Fixes NIR validation fail in OpenCL's test_basic hiloeo subtest.

v2: Clamp -> round rename.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17194>
src/compiler/nir/nir_opt_shrink_vectors.c