From b1b579293afc2f16fea9463e3e528fbdcfadafdf Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Thu, 28 May 2026 11:40:48 -0700 Subject: [PATCH] jay: Handle facing that differs across subspans Will be useful for multipolygon modes. Reviewed-by: Alyssa Rosenzweig Part-of: --- src/intel/compiler/jay/jay_from_nir.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/intel/compiler/jay/jay_from_nir.c b/src/intel/compiler/jay/jay_from_nir.c index eacd0588f97..02f7646ef64 100644 --- a/src/intel/compiler/jay/jay_from_nir.c +++ b/src/intel/compiler/jay/jay_from_nir.c @@ -1506,9 +1506,10 @@ jay_emit_intrinsic(struct nir_to_jay_state *nj, nir_intrinsic_instr *intr) break; case nir_intrinsic_load_front_face: { - /* Bit 11 is facingness for the first polygon. TODO: Multipolygon. */ - jay_inst *and = jay_AND(b, JAY_TYPE_U32, jay_null(), - jay_extract(nj->payload.u0, 9), BITFIELD_BIT(11)); + /* Bit 11 is facingness for subspans 1-2 and 5-6. */ + jay_inst *and = + jay_EXTRACT_SUBSPAN_INFO(b, jay_null(), jay_extract(nj->payload.u0, 9), + payload_u1(nj, 9, 1), BITFIELD_BIT(11)); /* The bit is actually backfacingness so check for equality with 0 */ jay_set_conditional_mod(b, and, dst, GEN_CONDITION_EQ);