diff options
author | Marek Olšák <[email protected]> | 2019-05-24 17:25:04 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-07-03 15:51:13 -0400 |
commit | f81aa6b0c8117351aaf67dd9dfe5a68fe48ded0a (patch) | |
tree | 6fb70823970ad121b143edaac0c9434fb9f9683f /src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c | |
parent | 7c805a7c670ca588b5c5a17f7563131caf22e81b (diff) |
radeonsi/gfx10: fix shader images
Don't promote 2D image instructions to 3D, and don't set z=BASE_ARRAY.
Acked-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c | 5 |
1 files 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 |