r600/sfn: Add lowering pass to legalize image access
authorGert Wollny <gert.wollny@collabora.com>
Mon, 10 May 2021 05:57:43 +0000 (07:57 +0200)
committerGert Wollny <gert.wollny@collabora.com>
Tue, 18 May 2021 20:16:07 +0000 (22:16 +0200)
commit27f51577774149d788adc2e3221a1b2b733ebb9f
tree42559ed11be0f6c2e7edbfff61a6e73eb9f2e0d3
parentffc5be25ca0b1571fb3640cd181a3477eec6c9e7
r600/sfn: Add lowering pass to legalize image access

Make sure only existing images are accessed and that the accessed
coordinates are within the image.
The generated code is quite exponsive, because it encapsulates each
access to an image with two if statements, one to check whether the
image index actually exists (this will get optimized away if the
image selection is direct), and one if statement to check whether
the coordinates are in range. For that reason it will only be enabled
for Cayman were invalid access seems to raise more issues.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10608>
src/gallium/drivers/r600/Makefile.sources
src/gallium/drivers/r600/meson.build
src/gallium/drivers/r600/sfn/sfn_nir.h
src/gallium/drivers/r600/sfn/sfn_nir_legalize_image_load_store.cpp [new file with mode: 0644]