nir_lower_readonly_images_to_tex: Support non-CL semantics
authorJesse Natalie <jenatali@microsoft.com>
Tue, 20 Apr 2021 15:08:32 +0000 (08:08 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 23 Apr 2021 23:16:15 +0000 (23:16 +0000)
commitfa677c8644c304833becee447ec6f3cc54f9a2a8
tree72fb53aa3b6800a988d0f583124572ccd393896a
parent29c973140065f05f56aab254c70013d11e969c45
nir_lower_readonly_images_to_tex: Support non-CL semantics

For non-CL, intrinsic access isn't set, because the image type doesn't
have access qualifier. Instead, the access qualifier is set on the variable.

So, add a mode to this pass which can chase back to the variable in addition
to the intrinsic access. Also, update the variable type and the deref chain
types so everything is consistent, that the tex is accessing a sampler. Note
we can't do this for CL, because void-typed samplers don't exist.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10356>
src/compiler/nir/nir.h
src/compiler/nir/nir_lower_readonly_images_to_tex.c
src/gallium/frontends/clover/nir/invocation.cpp
src/microsoft/clc/clc_compiler.c