aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2014-09-13 11:49:55 -0700
committerJason Ekstrand <[email protected]>2014-09-30 10:29:14 -0700
commit4d5f0eb0487ad13e90f7248c95c023c35457eaf9 (patch)
tree1315cb4b9c98376f12af499ac5b95cc005b8e0b7
parent54688cd03b087740173b0e11638df1cf0f3a19e1 (diff)
i965/fs: Refactor fs_inst::is_send_from_grf()
A switch statement is much easier to read/edit than a big giant or statement. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Matt Turner <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index e93010b59f5..99a33bd0647 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -368,15 +368,22 @@ fs_inst::overwrites_reg(const fs_reg &reg) const
bool
fs_inst::is_send_from_grf() const
{
- return (opcode == FS_OPCODE_VARYING_PULL_CONSTANT_LOAD_GEN7 ||
- opcode == SHADER_OPCODE_SHADER_TIME_ADD ||
- opcode == FS_OPCODE_INTERPOLATE_AT_CENTROID ||
- opcode == FS_OPCODE_INTERPOLATE_AT_SAMPLE ||
- opcode == FS_OPCODE_INTERPOLATE_AT_SHARED_OFFSET ||
- opcode == FS_OPCODE_INTERPOLATE_AT_PER_SLOT_OFFSET ||
- (opcode == FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD &&
- src[1].file == GRF) ||
- (is_tex() && src[0].file == GRF));
+ switch (opcode) {
+ case FS_OPCODE_VARYING_PULL_CONSTANT_LOAD_GEN7:
+ case SHADER_OPCODE_SHADER_TIME_ADD:
+ case FS_OPCODE_INTERPOLATE_AT_CENTROID:
+ case FS_OPCODE_INTERPOLATE_AT_SAMPLE:
+ case FS_OPCODE_INTERPOLATE_AT_SHARED_OFFSET:
+ case FS_OPCODE_INTERPOLATE_AT_PER_SLOT_OFFSET:
+ return true;
+ case FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD:
+ return src[1].file == GRF;
+ default:
+ if (is_tex())
+ return src[0].file == GRF;
+
+ return false;
+ }
}
bool