jay/partition: validate we don't generate g127<2>

GPU hangs with a buggy version of the next patch. EU validate misses this :(

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41872>
This commit is contained in:
Alyssa Rosenzweig 2026-05-28 12:49:50 -04:00 committed by Marge Bot
parent 3905c7156d
commit 7221ef0230

View file

@ -87,6 +87,12 @@ build_partition(jay_shader *shader, struct jay_partition_builder *b, unsigned n)
assert(B.start_grf + len_grf <= JAY_NUM_PHYS_GRF && "GRF file size");
assert(!BITSET_TEST_COUNT(regs, B.start_grf, len_grf) && "uniqueness");
/* This requirement avoids invalid constructions like g127<2> */
if (file == GPR && B.stride == JAY_STRIDE_8) {
assert(util_is_aligned(len_grf, 2 * jay_grf_per_gpr(shader)) &&
"must be a multiple of 2 GPRs");
}
BITSET_SET_COUNT(regs, B.start_grf, len_grf);
}
}