nir: Add a pass for lowering CL-style image ops to texture ops

In CL 1.2, images are required to be either read-only or write-only.  We
can always translate the read-only image ops to texture ops.  In CL 2.0
(and an extension), the ability is added to have read-write images but
sampling (with a sampler) is only allowed on read-only images.  As long
as we only lower read-only images to texture ops, everything should stay
consistent.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6578>
4 files changed