[Mesa-dev] [PATCH 06/10] i965/fs: Consider subregister writes to be writing a register.

Matt Turner mattst88 at gmail.com
Wed Feb 4 20:21:23 PST 2015


Since .stride is 0 for a scalar write, we calculated regs_written = 0
for a mov(1) instruction. Instruction scheduling loops from 0 to
regs_written when calculating dependencies, so this would cause
problems.
---
 src/mesa/drivers/dri/i965/brw_fs.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 2046eba..3142ab4 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -123,7 +123,7 @@ fs_inst::init(enum opcode opcode, uint8_t exec_size, const fs_reg &dst,
    case HW_REG:
    case MRF:
    case ATTR:
-      this->regs_written = (dst.width * dst.stride * type_sz(dst.type) + 31) / 32;
+      this->regs_written = MAX2((dst.width * dst.stride * type_sz(dst.type) + 31) / 32, 1);
       break;
    case BAD_FILE:
       this->regs_written = 0;
-- 
2.0.4



More information about the mesa-dev mailing list