nir: Add a pass for lowering CL-style image ops to texture ops
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 2 Sep 2020 21:51:51 +0000 (16:51 -0500)
committerMarge Bot <eric+marge@anholt.net>
Sun, 20 Sep 2020 14:28:13 +0000 (14:28 +0000)
commite1fc23265f9f9e89a38f10c95289301563e0f957
tree4d24b9453fb840abf1989a96164baf396d2c1f18
parent3fc425b3559dcec5b3277e27d4a14e065a406982
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>
src/compiler/Makefile.sources
src/compiler/nir/meson.build
src/compiler/nir/nir.h
src/compiler/nir/nir_lower_cl_images_to_tex.c [new file with mode: 0644]