summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2016-05-27 16:41:35 -0700
committerFrancisco Jerez <[email protected]>2016-05-31 15:57:40 -0700
commit4b0ec9f4759bab68b51e2f410e9305e39c1e1e7f (patch)
tree9fad393dc096e0574b6e57b84d7a3c715ce89819 /src/mesa
parentbb61e24787952a4796a687a86200a05cf83af7e9 (diff)
i965/fs: Fix compute-to-mrf VGRF region coverage condition.
Compute-to-mrf was checking whether the destination of scan_inst is more than one component (making assumptions about the instruction data type) in order to find out whether the result is being fully copied into the MRF destination, which is rather inaccurate in cases where a single-component instruction is only partially contained in the source region, or when the execution size of the copy and scan_inst instructions differ. Instead check whether the destination region of the instruction is really contained within the bounds of the source region of the copy. Cc: "12.0" <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 172182a3b62..b521f905e1c 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2816,10 +2816,13 @@ fs_visitor::compute_to_mrf()
if (scan_inst->is_partial_write())
break;
- /* Things returning more than one register would need us to
- * understand coalescing out more than one MOV at a time.
+ /* Handling things not fully contained in the source of the copy
+ * would need us to understand coalescing out more than one MOV at
+ * a time.
*/
- if (scan_inst->regs_written > scan_inst->exec_size / 8)
+ if (scan_inst->dst.reg_offset < inst->src[0].reg_offset ||
+ scan_inst->dst.reg_offset + scan_inst->regs_written >
+ inst->src[0].reg_offset + inst->regs_read(0))
break;
/* SEND instructions can't have MRF as a destination. */