[Mesa-dev] [PATCH 23/41] i965/fs: Determine partial writes based on the destination width

Jason Ekstrand jason at jlekstrand.net
Sat Sep 20 10:23:12 PDT 2014


Now that we track both halves of a 16-wide vgrf, we no longer need to worry
about force_sechalf or force_uncompressed.  The only real issue is if the
destination is too small.

Signed-off-by: Jason Ekstrand <jason.ekstrand at intel.com>
---
 src/mesa/drivers/dri/i965/brw_fs.cpp              | 4 ++--
 src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp | 4 +---
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 180568a..af7e1c9 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -823,8 +823,8 @@ bool
 fs_inst::is_partial_write() const
 {
    return ((this->predicate && this->opcode != BRW_OPCODE_SEL) ||
-           this->force_uncompressed ||
-           this->force_sechalf || !this->dst.is_contiguous());
+           (this->dst.width * type_sz(this->dst.type)) < 32 ||
+           !this->dst.is_contiguous());
 }
 
 int
diff --git a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
index 71f01cb..b42f1e5 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
@@ -753,11 +753,9 @@ fs_visitor::spill_reg(int spill_reg)
           * inst->regs_written(), then we need to unspill the destination
           * since we write back out all of the regs_written().
 	  */
-	 if (inst->predicate || inst->force_uncompressed ||
-             inst->force_sechalf || inst->dst.subreg_offset) {
+	 if (inst->is_partial_write())
             emit_unspill(block, inst, spill_src, subset_spill_offset,
                          inst->regs_written);
-	 }
 
          emit_spill(block, inst, spill_src, subset_spill_offset,
                     inst->regs_written);
-- 
2.1.0



More information about the mesa-dev mailing list