From ed595c1785dd229e53ce4cc256d0b61852aa6a50 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Sun, 9 May 2021 19:14:16 +0200 Subject: [PATCH] r600/sfn: legalize image access on Cayman This, seems to avoid hardware resets with the ARB_shader_image_load_store-invalid piglit. Signed-off-by: Gert Wollny Part-of: --- src/gallium/drivers/r600/sfn/sfn_nir.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/drivers/r600/sfn/sfn_nir.cpp b/src/gallium/drivers/r600/sfn/sfn_nir.cpp index 275df7a73e0..60c710a5884 100644 --- a/src/gallium/drivers/r600/sfn/sfn_nir.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_nir.cpp @@ -863,6 +863,12 @@ int r600_shader_from_nir(struct r600_context *rctx, r600::sort_uniforms(sel->nir); + /* Cayman seems very crashy about accessing images that don't exists or are + * accessed out of range, this lowering seems to help (but it can also be + * another problem */ + if (sel->nir->info.num_images > 0 && rctx->b.chip_class == CAYMAN) + NIR_PASS_V(sel->nir, r600_legalize_image_load_store); + NIR_PASS_V(sel->nir, nir_lower_vars_to_ssa); NIR_PASS_V(sel->nir, nir_lower_regs_to_ssa); nir_lower_idiv_options idiv_options = {