From d4dfae313e610ec0293bd67c7646c79a3d35badd Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Wed, 30 Nov 2022 15:25:35 +0100 Subject: [PATCH] r600/sfn: legalize image acccess on Cayman 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 Part-of: --- src/gallium/drivers/r600/sfn/sfn_nir.cpp | 3 +++ .../drivers/r600/sfn/sfn_nir_legalize_image_load_store.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/src/gallium/drivers/r600/sfn/sfn_nir.cpp b/src/gallium/drivers/r600/sfn/sfn_nir.cpp index 357f27a6331..2e639fe4cae 100644 --- a/src/gallium/drivers/r600/sfn/sfn_nir.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_nir.cpp @@ -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)) ; diff --git a/src/gallium/drivers/r600/sfn/sfn_nir_legalize_image_load_store.cpp b/src/gallium/drivers/r600/sfn/sfn_nir_legalize_image_load_store.cpp index 60c5a11470d..ec2146b2847 100644 --- a/src/gallium/drivers/r600/sfn/sfn_nir_legalize_image_load_store.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_nir_legalize_image_load_store.cpp @@ -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;