diff --git a/src/intel/compiler/brw_inst.cpp b/src/intel/compiler/brw_inst.cpp index ecf29d7b3f1..4925e6fae8b 100644 --- a/src/intel/compiler/brw_inst.cpp +++ b/src/intel/compiler/brw_inst.cpp @@ -395,7 +395,7 @@ brw_inst::can_change_types() const * it. */ bool -brw_inst::is_partial_write() const +brw_inst::is_partial_write(unsigned grf_size) const { if (this->predicate && !this->predicate_trivial && this->opcode != BRW_OPCODE_SEL) @@ -404,10 +404,10 @@ brw_inst::is_partial_write() const if (!this->dst.is_contiguous()) return true; - if (this->dst.offset % REG_SIZE != 0) + if (this->dst.offset % grf_size != 0) return true; - return this->size_written % REG_SIZE != 0; + return this->size_written % grf_size != 0; } unsigned @@ -1239,4 +1239,3 @@ is_coalescing_payload(const brw_shader &s, const brw_inst *inst) inst->src[0].offset == 0 && s.alloc.sizes[inst->src[0].nr] * REG_SIZE == inst->size_written; } - diff --git a/src/intel/compiler/brw_inst.h b/src/intel/compiler/brw_inst.h index e983d8265eb..84dd35b008d 100644 --- a/src/intel/compiler/brw_inst.h +++ b/src/intel/compiler/brw_inst.h @@ -66,7 +66,7 @@ public: bool is_send_from_grf() const; bool is_payload(unsigned arg) const; - bool is_partial_write() const; + bool is_partial_write(unsigned grf_size = REG_SIZE) const; unsigned components_read(unsigned i) const; unsigned size_read(const struct intel_device_info *devinfo, int arg) const; bool can_do_source_mods(const struct intel_device_info *devinfo) const; diff --git a/src/intel/compiler/brw_reg_allocate.cpp b/src/intel/compiler/brw_reg_allocate.cpp index 7673b5219cf..a4d127bf2a7 100644 --- a/src/intel/compiler/brw_reg_allocate.cpp +++ b/src/intel/compiler/brw_reg_allocate.cpp @@ -1227,7 +1227,7 @@ brw_reg_alloc::spill_reg(unsigned spill_reg) * write, there should be no need for the unspill since the * instruction will be overwriting the whole destination in any case. */ - if (inst->is_partial_write() || + if (inst->is_partial_write(reg_unit(devinfo) * REG_SIZE) || (!inst->force_writemask_all && !per_channel)) emit_unspill(ubld, &fs->shader_stats, spill_src, subset_spill_offset, regs_written(inst), ip);