summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2016-05-26 23:53:31 -0700
committerFrancisco Jerez <[email protected]>2016-05-31 15:22:04 -0700
commit88f380a2ddbdeda6e83725403b12ee0070f1f0f3 (patch)
treebeacd1acbd06919032faef4e056f1fb9876e8eb2 /src
parent604010a7edbe03ff65720cab8dddba1d0ca1571b (diff)
i965/fs: Teach regions_overlap() about COMPR4 MRF regions.
Cc: "12.0" <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_ir_fs.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_ir_fs.h b/src/mesa/drivers/dri/i965/brw_ir_fs.h
index 7b1ec68e683..f2144835584 100644
--- a/src/mesa/drivers/dri/i965/brw_ir_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_ir_fs.h
@@ -204,9 +204,23 @@ reg_offset(const fs_reg &r)
static inline bool
regions_overlap(const fs_reg &r, unsigned dr, const fs_reg &s, unsigned ds)
{
- return reg_space(r) == reg_space(s) &&
- !(reg_offset(r) + dr <= reg_offset(s) ||
- reg_offset(s) + ds <= reg_offset(r));
+ if (r.file == MRF && (r.nr & BRW_MRF_COMPR4)) {
+ fs_reg t = r;
+ t.nr &= ~BRW_MRF_COMPR4;
+ /* COMPR4 regions are translated by the hardware during decompression
+ * into two separate half-regions 4 MRFs apart from each other.
+ */
+ return regions_overlap(t, dr / 2, s, ds) ||
+ regions_overlap(byte_offset(t, 4 * REG_SIZE), dr / 2, s, ds);
+
+ } else if (s.file == MRF && (s.nr & BRW_MRF_COMPR4)) {
+ return regions_overlap(s, ds, r, dr);
+
+ } else {
+ return reg_space(r) == reg_space(s) &&
+ !(reg_offset(r) + dr <= reg_offset(s) ||
+ reg_offset(s) + ds <= reg_offset(r));
+ }
}
/**