spirv: Plumb access qualifiers through from image types
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 2 Sep 2020 21:11:38 +0000 (16:11 -0500)
committerMarge Bot <eric+marge@anholt.net>
Sun, 20 Sep 2020 14:28:13 +0000 (14:28 +0000)
commit3fc425b3559dcec5b3277e27d4a14e065a406982
treea6f4f7ff3fb87792e0e869a702297ac78a523ed1
parent1e902102c491a5af0f3c129afbabc0ec7a4f6b29
spirv: Plumb access qualifiers through from image types

In SPIR-V, the access qualifiers for an image are provided on the image
type.  Assuming no one swaps the types around on us (I think that should
be illegal), this means we can reliably fetch the access qualifiers from
the type itself.  The ops which don't really have an easy-to-fetch type
are the atomics because they use OpImageTexelPointer.  However, those
are only allowed on read/write images and that's the default.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6578>
src/compiler/spirv/spirv_to_nir.c