From 4915231b8a786466041f34dd3e83f31470d40dde Mon Sep 17 00:00:00 2001 From: "Kristian H. Kristensen" Date: Tue, 22 Oct 2019 19:29:07 -0700 Subject: [PATCH] freedreno/ir3: Implement tess coord intrinsic Our lowering pass made the z component unused by replacing its uses by 1 - x - y. The intrinsic implementation then just need to return the x and y components. Signed-off-by: Kristian H. Kristensen Acked-by: Eric Anholt Reviewed-by: Rob Clark --- src/freedreno/ir3/ir3_compiler_nir.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c index 8ed5b2f91fa..b2068a35466 100644 --- a/src/freedreno/ir3/ir3_compiler_nir.c +++ b/src/freedreno/ir3/ir3_compiler_nir.c @@ -1394,6 +1394,18 @@ emit_intrinsic(struct ir3_context *ctx, nir_intrinsic_instr *intr) dst[0] = ctx->primitive_id; break; + case nir_intrinsic_load_tess_coord: + if (!ctx->tess_coord) { + ctx->tess_coord = create_input_compmask(ctx, 0, 0x3); + add_sysval_input_compmask(ctx, SYSTEM_VALUE_TESS_COORD, + 0x3, ctx->tess_coord); + } + ir3_split_dest(b, dst, ctx->tess_coord, 0, 2); + + /* Unused, but ir3_put_dst() below wants to free something */ + dst[2] = create_immed(b, 0); + break; + case nir_intrinsic_store_global_ir3: { struct ir3_instruction *value, *addr, *offset; -- 2.30.2