brw/algebraic: Protect SHUFFLE from OOB indices

Akin to b67230de63 ("intel/fs: Protect opt_algebraic from OOB BROADCAST
indices"), we need to protect SHUFFLE as well.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13351
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36779>
This commit is contained in:
Matt Turner 2025-08-14 10:44:48 -07:00 committed by Marge Bot
parent a693539ff9
commit b4b692c486

View file

@ -741,9 +741,9 @@ brw_opt_algebraic(brw_shader &s)
inst->resize_sources(1);
progress = true;
} else if (inst->src[1].file == IMM) {
const unsigned comp = inst->src[1].ud & (inst->exec_size - 1);
inst->opcode = BRW_OPCODE_MOV;
inst->src[0] = component(inst->src[0],
inst->src[1].ud);
inst->src[0] = component(inst->src[0], comp);
inst->resize_sources(1);
progress = true;
}