spirv: Handle OOB vector extract operations
authorJason Ekstrand <jason@jlekstrand.net>
Thu, 9 Apr 2020 21:44:33 +0000 (16:44 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 17 Apr 2020 19:21:44 +0000 (19:21 +0000)
commit380bf556bfe34357f802dc49e1e104dc8fdf951a
tree5fb559a374bc020ac01ef5ae49e03ede5a069fb5
parentdc3a17997b479f91f36b2421e9c41c11a025de47
spirv: Handle OOB vector extract operations

We use vtn_vector_extract to handle vector component level derefs.  This
makes us gracefully handle the case where your vector component is OOB
and give you an undef.  The SPIR-V working group is still working out
whether or not this is technically legal but it's very little code for
us to handle it so we may as well.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4495>
src/compiler/spirv/spirv_to_nir.c