ac/nir: support v2f16 derivatives
authorMarek Olšák <marek.olsak@amd.com>
Mon, 11 May 2020 07:01:50 +0000 (03:01 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 2 Jun 2020 20:29:25 +0000 (16:29 -0400)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5003>

src/amd/llvm/ac_llvm_build.c

index 7fa2e38361e4730df9c9dcbbc73e02d0d423fe03..ef4e79c85f0e8e8dcbb9a210c484b5d6d6bceb6f 100644 (file)
@@ -2055,6 +2055,8 @@ ac_build_ddxy(struct ac_llvm_context *ctx,
 
        if (result_type == ctx->f16)
                val = LLVMBuildZExt(ctx->builder, val, ctx->i32, "");
+       else if (result_type == ctx->v2f16)
+               val = LLVMBuildBitCast(ctx->builder, val, ctx->i32, "");
 
        for (unsigned i = 0; i < 4; ++i) {
                tl_lanes[i] = i & mask;