summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2017-08-01 12:24:01 +0200
committerBas Nieuwenhuizen <[email protected]>2017-08-02 08:43:13 +0200
commit341578a6aea31c13bc4dd04011fb0e48ac7db19e (patch)
tree3cb036988ae701f30e4bf63278bf951dcae72534 /src
parentf28c2e225668ed7977b301100140f4f7e7bf55e6 (diff)
ac/nir: Add float cast before shadow comparator clamp.
LLVM complained about passing an i32 to a float clamp. Signed-off-by: Bas Nieuwenhuizen <[email protected]> Fixes: 0f9e32519bb "ac/nir: clamp shadow texture comparison value on VI" Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/common/ac_nir_to_llvm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 3a6252395ba..83e111166ca 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -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