From 0b4d381ee004b76075468a02cfcad8fefcca8154 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Wed, 23 Jan 2019 14:58:40 +1100 Subject: [PATCH] ac/nir_to_llvm: fix clamp shadow reference for more hardware MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes the following piglit test on my VEGA and matches the behaviour in the tgsi backend. tests/spec/glsl-1.10/execution/samplers/glsl-fs-shadow2D-clamp-z.shader_test Fixes: 625dcbbc4566 ("amd/common: pass address components individually to ac_build_image_intrinsic") Reviewed-by: Marek Olšák (cherry picked from commit 5d66f7103f0df6b996951e65483fc5873d9b66df) --- src/amd/common/ac_nir_to_llvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c index 0aabd053d1e..fbe010d04e4 100644 --- a/src/amd/common/ac_nir_to_llvm.c +++ b/src/amd/common/ac_nir_to_llvm.c @@ -3499,7 +3499,7 @@ static void visit_tex(struct ac_nir_context *ctx, nir_tex_instr *instr) * It's unnecessary if the original texture format was * Z32_FLOAT, but we don't know that here. */ - if (args.compare && ctx->ac.chip_class == VI && ctx->abi->clamp_shadow_reference) + if (args.compare && ctx->ac.chip_class >= VI && ctx->abi->clamp_shadow_reference) args.compare = ac_build_clamp(&ctx->ac, ac_to_float(&ctx->ac, args.compare)); /* pack derivatives */ -- 2.11.0