jay: Handle facing that differs across subspans

Will be useful for multipolygon modes.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41872>
This commit is contained in:
Kenneth Graunke 2026-05-28 11:40:48 -07:00 committed by Marge Bot
parent e3d7d4a77d
commit b1b579293a

View file

@ -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);