nir/lower_io: Apply alignments from derefs when available
authorJason Ekstrand <jason@jlekstrand.net>
Mon, 24 Aug 2020 15:57:57 +0000 (10:57 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 3 Sep 2020 18:02:50 +0000 (18:02 +0000)
commitbeefd37021edd707274625def137bed0df6fb65f
tree7834d07c12a129977239f690b89d33433d4c762a
parent480329cf8b319983ee96f2b57bd2648be19e5570
nir/lower_io: Apply alignments from derefs when available

If the deref has no explicit alignment in the chain, we assume component
alignment which is what we currently assume for all derefs today.  This
should be correct for all APIs in the sense that we can usually assume
at least component alignment.  However, for some APIs such as OpenCL, we
could potentially make larger alignment assumptions.  The intention is
that those will be handled via alignment-increasing casts.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6472>
src/compiler/nir/nir_lower_io.c