r600/sfn: legalize image acccess on Cayman
authorGert Wollny <gert.wollny@collabora.com>
Wed, 30 Nov 2022 14:25:35 +0000 (15:25 +0100)
committerMarge Bot <emma+marge@anholt.net>
Sun, 4 Dec 2022 17:11:28 +0000 (17:11 +0000)
If we access non-existing images Cayman hardware may lock up
and trigger a reset that is not always successful. Therefore,
make sure the images access is legal.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20141>

src/gallium/drivers/r600/sfn/sfn_nir.cpp
src/gallium/drivers/r600/sfn/sfn_nir_legalize_image_load_store.cpp

index 357f27a..2e639fe 100644 (file)
@@ -774,6 +774,9 @@ r600_finalize_nir(pipe_screen *screen, void *shader)
    NIR_PASS_V(nir, r600_lower_shared_io);
    NIR_PASS_V(nir, r600_nir_lower_atomics);
 
+   if (rs->b.gfx_level == CAYMAN)
+      NIR_PASS_V(nir, r600_legalize_image_load_store);
+
    while (optimize_once(nir))
       ;
 
index 60c5a11..ec2146b 100644 (file)
@@ -69,6 +69,7 @@ r600_legalize_image_load_store_impl(nir_builder *b,
          num_components = 1;
          break;
       case GLSL_SAMPLER_DIM_2D:
+      case GLSL_SAMPLER_DIM_MS:
       case GLSL_SAMPLER_DIM_RECT:
       case GLSL_SAMPLER_DIM_CUBE:
          num_components = 2;