summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2023-01-10 15:12:24 -0800
committerJordan Justen <jordan.l.justen@intel.com>2024-05-15 09:49:42 -0700
commit01b1528ccff4064ef24716e180b8b8f18b0e68b2 (patch)
tree7c653b6ff7aa412cdc3a3e6aa720386ae4134895
parentb95630d89abf13a42229cfcc34ee6feca90732c7 (diff)
intel/brw/xe2+: Round up spill/unspill data size to nearest reg_size multiple.xe2-compiler-2
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28283>
-rw-r--r--src/intel/compiler/brw_fs_reg_allocate.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/intel/compiler/brw_fs_reg_allocate.cpp b/src/intel/compiler/brw_fs_reg_allocate.cpp
index 7d3bdd76467..d2cb4ea4d4a 100644
--- a/src/intel/compiler/brw_fs_reg_allocate.cpp
+++ b/src/intel/compiler/brw_fs_reg_allocate.cpp
@@ -640,9 +640,8 @@ fs_reg_alloc::emit_unspill(const fs_builder &bld,
const intel_device_info *devinfo = bld.shader->devinfo;
const unsigned reg_size = dst.component_size(bld.dispatch_width()) /
REG_SIZE;
- assert(count % reg_size == 0);
- for (unsigned i = 0; i < count / reg_size; i++) {
+ for (unsigned i = 0; i < DIV_ROUND_UP(count, reg_size); i++) {
++stats->fill_count;
fs_inst *unspill_inst;
@@ -715,6 +714,7 @@ fs_reg_alloc::emit_unspill(const fs_builder &bld,
BRW_DATAPORT_OWORD_BLOCK_DWORDS(reg_size * 8));
}
_mesa_set_add(spill_insts, unspill_inst);
+ assert(unspill_inst->force_writemask_all || count % reg_size == 0);
dst.offset += reg_size * REG_SIZE;
spill_offset += reg_size * REG_SIZE;
@@ -730,9 +730,8 @@ fs_reg_alloc::emit_spill(const fs_builder &bld,
const intel_device_info *devinfo = bld.shader->devinfo;
const unsigned reg_size = src.component_size(bld.dispatch_width()) /
REG_SIZE;
- assert(count % reg_size == 0);
- for (unsigned i = 0; i < count / reg_size; i++) {
+ for (unsigned i = 0; i < DIV_ROUND_UP(count, reg_size); i++) {
++stats->spill_count;
fs_inst *spill_inst;
@@ -794,6 +793,7 @@ fs_reg_alloc::emit_spill(const fs_builder &bld,
BRW_DATAPORT_OWORD_BLOCK_DWORDS(reg_size * 8));
}
_mesa_set_add(spill_insts, spill_inst);
+ assert(spill_inst->force_writemask_all || count % reg_size == 0);
src.offset += reg_size * REG_SIZE;
spill_offset += reg_size * REG_SIZE;