spirv: Propagate alignments to deref chains via casts
authorJason Ekstrand <jason@jlekstrand.net>
Thu, 27 Aug 2020 23:34:50 +0000 (18:34 -0500)
committerMarge Bot <eric+marge@anholt.net>
Thu, 3 Sep 2020 18:02:50 +0000 (18:02 +0000)
commit3135984ad0bde072b25e1641e2a9e154fb62a087
treeed138144318216e19189b891c67f035d0d7a0c60
parent207b462e9326b4e7aab8e3c4aead7ca23147e527
spirv: Propagate alignments to deref chains via casts

This commit propagates the alignment information provided either through
the Alignment decoration on pointers or via the alignment mem operands
to OpLoad, OpStore, and OpCopyMemory to the NIR deref chain.  It does so
by wrapping the deref in a cast.  NIR should be able to clean up most
unnecessary casts only leaving us with the useful alignment information.

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_builder.h
src/compiler/spirv/vtn_variables.c