brw: align spilling offsets to physical register sizes
In commitfe3d90aedf
("intel/fs/xe2+: Fix calculation of spill message width for Xe2 regs.") we aligned the width of scratch messages to physical register sizes (32B prior to Xe2, 64B for Xe2+). But our spilling offsets are computed using the register allocations sizes which are in units of 32B. That means on Xe2, you can end up spilling a virtual register allocated at 32B (which we use for surface state computations with exec_all) and then the spilling of that register will be emitted in SIMD16, having the upper 8 lanes overwriting the next spilled register. We could potentially limit spills to SIMD8 messages on Xe2 (only writing 32B of data), but we're also unlikely to have all 32B virtual register spilled next to one another. And if not tightly packed, we would have 64B registers stored on 2 different cachelines which sounds inefficient. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Fixes:fe3d90aedf
("intel/fs/xe2+: Fix calculation of spill message width for Xe2 regs.") Backport-to: 24.2 Reviewed-by: Rohan Garg <rohan.garg@intel.com> Reviewed-by: Ivan Briano <ivan.briano@intel.com> Reviewed-by: Francisco Jerez <currojerez@riseup.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30983>
This commit is contained in:

committed by
Marge Bot

parent
4f99e84367
commit
aa494cbacf
@@ -940,7 +940,7 @@ fs_reg_alloc::spill_reg(unsigned spill_reg)
|
||||
|
||||
fs->spilled_any_registers = true;
|
||||
|
||||
fs->last_scratch += size * REG_SIZE;
|
||||
fs->last_scratch += align(size * REG_SIZE, REG_SIZE * reg_unit(devinfo));
|
||||
|
||||
/* We're about to replace all uses of this register. It no longer
|
||||
* conflicts with anything so we can get rid of its interference.
|
||||
@@ -964,7 +964,7 @@ fs_reg_alloc::spill_reg(unsigned spill_reg)
|
||||
inst->src[i].nr == spill_reg) {
|
||||
int count = regs_read(inst, i);
|
||||
int subset_spill_offset = spill_offset +
|
||||
ROUND_DOWN_TO(inst->src[i].offset, REG_SIZE);
|
||||
ROUND_DOWN_TO(inst->src[i].offset, REG_SIZE * reg_unit(devinfo));
|
||||
brw_reg unspill_dst = alloc_spill_reg(count, ip);
|
||||
|
||||
inst->src[i].nr = unspill_dst.nr;
|
||||
@@ -993,7 +993,7 @@ fs_reg_alloc::spill_reg(unsigned spill_reg)
|
||||
inst->dst.nr == spill_reg &&
|
||||
inst->opcode != SHADER_OPCODE_UNDEF) {
|
||||
int subset_spill_offset = spill_offset +
|
||||
ROUND_DOWN_TO(inst->dst.offset, REG_SIZE);
|
||||
ROUND_DOWN_TO(inst->dst.offset, reg_unit(devinfo) * REG_SIZE);
|
||||
brw_reg spill_src = alloc_spill_reg(regs_written(inst), ip);
|
||||
|
||||
inst->dst.nr = spill_src.nr;
|
||||
|
Reference in New Issue
Block a user