ac/nir: use ordered float comparisons except for not equal
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 23 Feb 2018 13:21:06 +0000 (14:21 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 26 Feb 2018 12:59:04 +0000 (13:59 +0100)
Original patch from Timothy Arceri, I have just fixed the
not equal case locally.

This fixes one important rendering issue in Wolfenstein 2
(the cutscene transition issue).

RadeonSI uses the same ordered comparisons, so I guess that
what we should do as well.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104302
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104905
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/amd/common/ac_nir_to_llvm.c

index 2c5a6e6cf6d8c81aa48450351c81961bbbdb0386..8183e48bd3e4b3fd3b1c9c64fc21a223f90a6264 100644 (file)
@@ -1797,16 +1797,16 @@ static void visit_alu(struct ac_nir_context *ctx, const nir_alu_instr *instr)
                result = emit_int_cmp(&ctx->ac, LLVMIntUGE, src[0], src[1]);
                break;
        case nir_op_feq:
-               result = emit_float_cmp(&ctx->ac, LLVMRealUEQ, src[0], src[1]);
+               result = emit_float_cmp(&ctx->ac, LLVMRealOEQ, src[0], src[1]);
                break;
        case nir_op_fne:
                result = emit_float_cmp(&ctx->ac, LLVMRealUNE, src[0], src[1]);
                break;
        case nir_op_flt:
-               result = emit_float_cmp(&ctx->ac, LLVMRealULT, src[0], src[1]);
+               result = emit_float_cmp(&ctx->ac, LLVMRealOLT, src[0], src[1]);
                break;
        case nir_op_fge:
-               result = emit_float_cmp(&ctx->ac, LLVMRealUGE, src[0], src[1]);
+               result = emit_float_cmp(&ctx->ac, LLVMRealOGE, src[0], src[1]);
                break;
        case nir_op_fabs:
                result = emit_intrin_1f_param(&ctx->ac, "llvm.fabs",