summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-09-17 16:00:38 +0200
committerJuan A. Suarez Romero <[email protected]>2017-09-20 22:54:12 +0200
commit0ec2f628d13fd86689c8575f6d4b5b5a0849cc7f (patch)
tree49a52e9b62cf6227d130fcc86dc52bf0876c30b6 /src/gallium
parent96f815aeabbd07a57cd8abbe7a54558aa0144de3 (diff)
radeonsi: fix array textures layer coordinate
Like for cube map (array) gather, we need to round to nearest on <= VI. Fixes tests in dEQP-GLES3.functional.shaders.texture_functions.texture.* Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]> (cherry picked from commit 87f7c7bd6566dbd95214df9b058bca5e6573374e) [Juan A. Suarez: apply patch over si_shader.c] Signed-off-by: Juan A. Suarez Romero <[email protected]> Conflicts: src/gallium/drivers/radeonsi/si_shader_tgsi_mem.c
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 3adb9daf400..57f6d2d276b 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -4655,13 +4655,22 @@ static void tex_fetch_args(
if (target == TGSI_TEXTURE_CUBE ||
target == TGSI_TEXTURE_CUBE_ARRAY ||
target == TGSI_TEXTURE_SHADOWCUBE ||
- target == TGSI_TEXTURE_SHADOWCUBE_ARRAY)
+ target == TGSI_TEXTURE_SHADOWCUBE_ARRAY) {
ac_prepare_cube_coords(&ctx->ac,
opcode == TGSI_OPCODE_TXD,
target == TGSI_TEXTURE_CUBE_ARRAY ||
target == TGSI_TEXTURE_SHADOWCUBE_ARRAY,
opcode == TGSI_OPCODE_LODQ,
coords, derivs);
+ } else if (tgsi_is_array_sampler(target) &&
+ opcode != TGSI_OPCODE_TXF &&
+ opcode != TGSI_OPCODE_TXF_LZ &&
+ ctx->screen->b.chip_class <= VI) {
+ unsigned array_coord = target == TGSI_TEXTURE_1D_ARRAY ? 1 : 2;
+ coords[array_coord] =
+ ac_build_intrinsic(&ctx->ac, "llvm.rint.f32", ctx->f32,
+ &coords[array_coord], 1, 0);
+ }
if (opcode == TGSI_OPCODE_TXD)
for (int i = 0; i < num_deriv_channels * 2; i++)