From: Kristian H. Kristensen Date: Wed, 23 Oct 2019 02:29:07 +0000 (-0700) Subject: freedreno/ir3: Implement tess coord intrinsic X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4915231b8a786466041f34dd3e83f31470d40dde;p=mesa.git 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 --- 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;