summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs.cpp
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2015-04-01 15:38:23 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2015-05-06 10:29:30 -0700
commit32af7d4188e286a525081ada9965070dd41dbab7 (patch)
tree9169a9b13b17333c526f4e575608140b54118dad /src/mesa/drivers/dri/i965/brw_fs.cpp
parent76c1086f2dfb37a1edf6d2df6eebbe11ccbfc50b (diff)
downloadexternal_mesa3d-32af7d4188e286a525081ada9965070dd41dbab7.zip
external_mesa3d-32af7d4188e286a525081ada9965070dd41dbab7.tar.gz
external_mesa3d-32af7d4188e286a525081ada9965070dd41dbab7.tar.bz2
i965/fs_inst: Add an is_copy_payload helper
This commit adds a new is_copy_payload helper to fs_inst that takes the place of the similarly named functions in cse and register coalesce. The two is_copy_payload functions in CSE and register coalesce were subtly different and potentially subtly broken. The new version unifies the two and should be more correct. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 22223e1..2a38854 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -521,6 +521,26 @@ fs_inst::is_send_from_grf() const
}
bool
+fs_inst::is_copy_payload(const brw::simple_allocator &grf_alloc) const
+{
+ if (this->opcode != SHADER_OPCODE_LOAD_PAYLOAD)
+ return false;
+
+ fs_reg reg = this->src[0];
+ if (reg.file != GRF || reg.reg_offset != 0 || reg.stride == 0)
+ return false;
+
+ if (grf_alloc.sizes[reg.reg] != this->regs_written)
+ return false;
+
+ for (int i = 1; i < this->sources; i++)
+ if (!this->src[i].equals(::offset(reg, i)))
+ return false;
+
+ return true;
+}
+
+bool
fs_inst::can_do_source_mods(const struct brw_device_info *devinfo)
{
if (devinfo->gen == 6 && is_math())