ac/nir: Add float cast before shadow comparator clamp.

LLVM complained about passing an i32 to a float clamp.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Fixes: 0f9e32519b "ac/nir: clamp shadow texture comparison value on VI"
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Bas Nieuwenhuizen
2017-08-01 12:24:01 +02:00
parent f28c2e2256
commit 341578a6ae
+2 -1
View 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