From 2ed36050fb9b5b890c69ae55c3efbef62e7e5e60 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Wed, 22 Jun 2022 16:35:59 -0700 Subject: [PATCH] intel/fs: Don't copy-propagate ATTR registers in multi-polygon FS shaders when invalid. Reviewed-by: Caio Oliveira Part-of: --- src/intel/compiler/brw_fs_copy_propagation.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/intel/compiler/brw_fs_copy_propagation.cpp b/src/intel/compiler/brw_fs_copy_propagation.cpp index a1d93657ac1..5c577ae4711 100644 --- a/src/intel/compiler/brw_fs_copy_propagation.cpp +++ b/src/intel/compiler/brw_fs_copy_propagation.cpp @@ -802,6 +802,17 @@ try_copy_propagate(const brw_compiler *compiler, fs_inst *inst, (reg_offset(inst->dst) % REG_SIZE) != (reg_offset(entry->src) % REG_SIZE)) return false; + /* The <8;8,0> regions used for FS attributes in multipolygon + * dispatch mode could violate regioning restrictions, don't copy + * propagate them in such cases. + */ + if (entry->src.file == ATTR && max_polygons > 1 && + (has_dst_aligned_region_restriction(devinfo, inst, dst_type) || + instruction_requires_packed_data(inst) || + (inst->is_3src(compiler) && arg == 2) || + entry->dst.type != inst->src[arg].type)) + return false; + /* Bail if the source FIXED_GRF region of the copy cannot be trivially * composed with the source region of the instruction -- E.g. because the * copy uses some extended stride greater than 4 not supported natively by