ac/nir: Add float cast before shadow comparator clamp.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 1 Aug 2017 10:24:01 +0000 (12:24 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 2 Aug 2017 06:43:13 +0000 (08:43 +0200)
LLVM complained about passing an i32 to a float clamp.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Fixes: 0f9e32519bb "ac/nir: clamp shadow texture comparison value on VI"
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/amd/common/ac_nir_to_llvm.c

index 3a6252395ba4ab058ff2d19830a8f6af9de19ec3..83e111166ca633f0d1a6c130d38c183c8034a893 100644 (file)
@@ -4495,7 +4495,8 @@ static void visit_tex(struct ac_nir_context *ctx, nir_tex_instr *instr)
 
        /* Pack depth comparison value */
        if (instr->is_shadow && comparator) {
-               LLVMValueRef z = llvm_extract_elem(&ctx->ac, comparator, 0);
+               LLVMValueRef z = to_float(&ctx->ac,
+                                         llvm_extract_elem(&ctx->ac, comparator, 0));
 
                /* TC-compatible HTILE promotes Z16 and Z24 to Z32_FLOAT,
                 * so the depth comparison value isn't clamped for Z16 and