aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2019-07-18 13:51:27 (GMT)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>2019-07-22 07:02:22 (GMT)
commit6049745b132c29fb62d3ab19e343f34311432e70 (patch)
treee71df45eff053b960212ed5fdbf52c6b9d69daac
parent64b7386ee8ebc16e5980d6952148663b46a5298a (diff)
downloadexternal_mesa3d-6049745b132c29fb62d3ab19e343f34311432e70.zip
external_mesa3d-6049745b132c29fb62d3ab19e343f34311432e70.tar.gz
external_mesa3d-6049745b132c29fb62d3ab19e343f34311432e70.tar.bz2
ac/nir: do not clamp shadow reference on GFX10
RadeonSI only uses Z32_FLOAT_CLAMP for upgraded depth textures on GFX10 and RADV doesn't promotes Z16 or Z24. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
-rw-r--r--src/amd/common/ac_nir_to_llvm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index f69e02f..ec79e5f 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -3805,12 +3805,16 @@ static void visit_tex(struct ac_nir_context *ctx, nir_tex_instr *instr)
/* TC-compatible HTILE on radeonsi promotes Z16 and Z24 to Z32_FLOAT,
* so the depth comparison value isn't clamped for Z16 and
- * Z24 anymore. Do it manually here.
+ * Z24 anymore. Do it manually here for GFX8-9; GFX10 has an explicitly
+ * clamped 32-bit float format.
*
* 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 >= GFX8 && ctx->abi->clamp_shadow_reference)
+ if (args.compare &&
+ ctx->ac.chip_class >= GFX8 &&
+ ctx->ac.chip_class <= GFX9 &&
+ ctx->abi->clamp_shadow_reference)
args.compare = ac_build_clamp(&ctx->ac, ac_to_float(&ctx->ac, args.compare));
/* pack derivatives */