summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2018-04-23 14:46:26 +0200
committerDylan Baker <dylan@pnwbakers.com>2018-04-26 10:46:43 -0700
commit523ff149942d9f47fdf8bd556302f767df2e73ef (patch)
tree34dc7535166cb6d4b3ffd91ff239b4adcc6b177c
parent5fb804f346d21f5c9320a8049ae5663fa8070654 (diff)
ac/nir: add missing round_slice for 1D arrays
This fixes a bunch of CTS fails with 1D arrays: dEQP-VK.glsl.texture_functions.texture*.sampler1darray_* Fixes: 625dcbbc456 ("amd/common: pass address components individually to ac_build_image_intrinsic") Cc: 18.1 <mesa-stable@lists.freedesktop.org> Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com> (cherry picked from commit 84fef802fb16cef68ec358cbfed1cac9c3bfa410)
-rw-r--r--src/amd/common/ac_nir_to_llvm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 72c773522f..34efb2b9fe 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -3397,6 +3397,13 @@ static void visit_tex(struct ac_nir_context *ctx, nir_tex_instr *instr)
}
/* Texture coordinates fixups */
+ if (instr->coord_components > 1 &&
+ instr->sampler_dim == GLSL_SAMPLER_DIM_1D &&
+ instr->is_array &&
+ instr->op != nir_texop_txf) {
+ args.coords[1] = apply_round_slice(&ctx->ac, args.coords[1]);
+ }
+
if (instr->coord_components > 2 &&
(instr->sampler_dim == GLSL_SAMPLER_DIM_2D ||
instr->sampler_dim == GLSL_SAMPLER_DIM_MS ||