From 7be50b714ceccecd06ef28bd48caa1acf7e1110e Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 2 Jun 2026 16:46:20 -0700 Subject: [PATCH] jay: Don't swap FS interpolation .yz deltas load_fs_interp_deltas wants .yz swapped, but load_input_vertex does not. For simplicity, keep the payload fields in hardware order and have the individual intrinsics swap. Part-of: --- src/intel/compiler/jay/jay_from_nir.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/intel/compiler/jay/jay_from_nir.c b/src/intel/compiler/jay/jay_from_nir.c index ec575dd4d04..bd485fdfc87 100644 --- a/src/intel/compiler/jay/jay_from_nir.c +++ b/src/intel/compiler/jay/jay_from_nir.c @@ -1592,8 +1592,12 @@ jay_emit_intrinsic(struct nir_to_jay_state *nj, nir_intrinsic_instr *intr) assert(intr->def.num_components == 1 && "should be scalarized"); } - /* Zeroth delta is the flat value */ - jay_copy(b, dst, fs->deltas[i]); + /* Zeroth delta is the flat value; .yz deltas are reversed from NIR */ + jay_MOV(b, jay_extract(dst, 0), jay_extract(fs->deltas[i], 0)); + if (intr->def.num_components > 1) { + jay_MOV(b, jay_extract(dst, 1), jay_extract(fs->deltas[i], 2)); + jay_MOV(b, jay_extract(dst, 2), jay_extract(fs->deltas[i], 1)); + } break; } @@ -2716,12 +2720,7 @@ setup_fragment_payload(struct nir_to_jay_state *nj, struct payload_builder *p) unsigned nr_attribs = 16 * 4; /* TODO */ for (unsigned i = 0; i < nr_attribs; ++i) { - jay_def comps[] = { read_payload(p, UGPR), read_payload(p, UGPR), - read_payload(p, UGPR) }; - - /* The .yz components are swizzled in the hardware compared to NIR. */ - SWAP(comps[1], comps[2]); - fs->deltas[i] = jay_collect_vectors(&nj->bld, comps, ARRAY_SIZE(comps)); + fs->deltas[i] = read_vector_payload(p, UGPR, 3); /* Padding */ if ((i % 5) == 4) {