ac/nir_to_llvm: fix clamp shadow reference for more hardware
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 23 Jan 2019 03:58:40 +0000 (14:58 +1100)
committerTimothy Arceri <tarceri@itsqueeze.com>
Sat, 26 Jan 2019 01:03:24 +0000 (12:03 +1100)
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 <marek.olsak@amd.com>
src/amd/common/ac_nir_to_llvm.c

index f509fc31dffc7fb052f8df5083ec04a0d31b8f03..b60ef86986486cbe0373cedeef66e8a5ad883fa2 100644 (file)
@@ -3586,7 +3586,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 */