From f81aa6b0c8117351aaf67dd9dfe5a68fe48ded0a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 24 May 2019 17:25:04 -0400 Subject: [PATCH] radeonsi/gfx10: fix shader images Don't promote 2D image instructions to 3D, and don't set z=BASE_ARRAY. Acked-by: Bas Nieuwenhuizen --- src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c index 8fdf26d115d..8d6a7dc8d67 100644 --- a/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c +++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c @@ -134,7 +134,7 @@ ac_image_dim_from_tgsi_target(struct si_screen *screen, enum tgsi_texture_type t if (dim == ac_image_cube || (screen->info.chip_class <= GFX8 && dim == ac_image_3d)) dim = ac_image_2darray; - else if (target == TGSI_TEXTURE_2D && screen->info.chip_class >= GFX9) { + else if (target == TGSI_TEXTURE_2D && screen->info.chip_class == GFX9) { /* When a single layer of a 3D texture is bound, the shader * will refer to a 2D target, but the descriptor has a 3D type. * Since the HW ignores BASE_ARRAY in this case, we need to @@ -294,7 +294,8 @@ static void image_fetch_coords( } else if (target == TGSI_TEXTURE_1D_ARRAY) { coords[2] = coords[1]; coords[1] = ctx->i32_0; - } else if (target == TGSI_TEXTURE_2D) { + } else if (ctx->screen->info.chip_class == GFX9 && + target == TGSI_TEXTURE_2D) { /* The hw can't bind a slice of a 3D image as a 2D * image, because it ignores BASE_ARRAY if the target * is 3D. The workaround is to read BASE_ARRAY and set -- 2.30.2