mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-21 13:40:16 +01:00
intel/brw: Handle SHADER_OPCODE_SEND without src[3] in copy prop
We construct some SENDs with only 3 sources (such as FB writes). This code could read out of bounds. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27876>
This commit is contained in:
parent
49606ab067
commit
f6ac6c94a9
1 changed files with 2 additions and 1 deletions
|
|
@ -698,7 +698,8 @@ try_copy_propagate(const brw_compiler *compiler, fs_inst *inst,
|
|||
* We need to pin both split SEND sources in g112-g126/127, so only
|
||||
* allow this if the registers aren't too large.
|
||||
*/
|
||||
if (inst->opcode == SHADER_OPCODE_SEND && entry->src.file == VGRF) {
|
||||
if (inst->opcode == SHADER_OPCODE_SEND && inst->sources >= 4 &&
|
||||
entry->src.file == VGRF) {
|
||||
int other_src = arg == 2 ? 3 : 2;
|
||||
unsigned other_size = inst->src[other_src].file == VGRF ?
|
||||
alloc.sizes[inst->src[other_src].nr] :
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue