ac/nir: Return frag_coord as integer.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 19 Mar 2019 00:29:43 +0000 (01:29 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 26 Mar 2019 08:41:15 +0000 (09:41 +0100)
To preserve the invariant that nir ssa defs are integers or pointers
in LLVM.

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/common/ac_nir_to_llvm.c

index 675623cbfeb7356498c153c05fdcaaeb0af8abe9..b25cc6a0a846af7f109d9d772ad9da6de0b86ff9 100644 (file)
@@ -3232,7 +3232,8 @@ static void visit_intrinsic(struct ac_nir_context *ctx,
                        ctx->abi->frag_pos[2],
                        ac_build_fdiv(&ctx->ac, ctx->ac.f32_1, ctx->abi->frag_pos[3])
                };
-               result = ac_build_gather_values(&ctx->ac, values, 4);
+               result = ac_to_integer(&ctx->ac,
+                                      ac_build_gather_values(&ctx->ac, values, 4));
                break;
        }
        case nir_intrinsic_load_front_face: