summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2014-06-23 21:57:31 -0700
committerMatt Turner <mattst88@gmail.com>2014-06-25 13:00:48 -0700
commit46659d46a8c2f7bbc8deb472faff2dccbde92d29 (patch)
tree57c9746c14aeb92975babfb1e6f2d18e0ed50328 /src/mesa
parentb4ef7c596b31675aea131870ba4c07aaad1f1525 (diff)
downloadexternal_mesa3d-46659d46a8c2f7bbc8deb472faff2dccbde92d29.zip
external_mesa3d-46659d46a8c2f7bbc8deb472faff2dccbde92d29.tar.gz
external_mesa3d-46659d46a8c2f7bbc8deb472faff2dccbde92d29.tar.bz2
i965: Make can_do_source_mods() a member of the instruction classes.
Pretty nonsensical to have it as a method of the visitor just for access to brw. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp8
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.h3
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp2
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4.cpp8
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4.h3
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp2
6 files changed, 12 insertions, 14 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 185a1f6..929379a 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -371,15 +371,15 @@ fs_inst::is_send_from_grf() const
}
bool
-fs_visitor::can_do_source_mods(fs_inst *inst)
+fs_inst::can_do_source_mods(struct brw_context *brw)
{
- if (brw->gen == 6 && inst->is_math())
+ if (brw->gen == 6 && is_math())
return false;
- if (inst->is_send_from_grf())
+ if (is_send_from_grf())
return false;
- if (!inst->can_do_source_mods())
+ if (!backend_instruction::can_do_source_mods())
return false;
return true;
diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h
index b86a31c..0da79ba 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.h
+++ b/src/mesa/drivers/dri/i965/brw_fs.h
@@ -208,6 +208,7 @@ public:
bool is_send_from_grf() const;
bool is_partial_write() const;
int regs_read(fs_visitor *v, int arg) const;
+ bool can_do_source_mods(struct brw_context *brw);
bool reads_flag() const;
bool writes_flag() const;
@@ -285,8 +286,6 @@ public:
uint32_t gather_channel(ir_texture *ir, int sampler);
void swizzle_result(ir_texture *ir, fs_reg orig_val, int sampler);
- bool can_do_source_mods(fs_inst *inst);
-
fs_inst *emit(fs_inst *inst);
void emit(exec_list list);
diff --git a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
index cc6e86f..0a7b8b8 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
@@ -314,7 +314,7 @@ fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry)
if ((has_source_modifiers || entry->src.file == UNIFORM ||
!entry->src.is_contiguous()) &&
- !can_do_source_mods(inst))
+ !inst->can_do_source_mods(brw))
return false;
/* Bail if the result of composing both strides would exceed the
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index ee5be56..24903f9 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -250,15 +250,15 @@ vec4_instruction::is_send_from_grf()
}
bool
-vec4_visitor::can_do_source_mods(vec4_instruction *inst)
+vec4_instruction::can_do_source_mods(struct brw_context *brw)
{
- if (brw->gen == 6 && inst->is_math())
+ if (brw->gen == 6 && is_math())
return false;
- if (inst->is_send_from_grf())
+ if (is_send_from_grf())
return false;
- if (!inst->can_do_source_mods())
+ if (!backend_instruction::can_do_source_mods())
return false;
return true;
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h
index 20d717a..366ef02 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.h
+++ b/src/mesa/drivers/dri/i965/brw_vec4.h
@@ -265,6 +265,7 @@ public:
bool is_send_from_grf();
bool can_reswizzle_dst(int dst_writemask, int swizzle, int swizzle_mask);
void reswizzle_dst(int dst_writemask, int swizzle);
+ bool can_do_source_mods(struct brw_context *brw);
bool reads_flag()
{
@@ -430,8 +431,6 @@ public:
void opt_set_dependency_control();
void opt_schedule_instructions();
- bool can_do_source_mods(vec4_instruction *inst);
-
vec4_instruction *emit(vec4_instruction *inst);
vec4_instruction *emit(enum opcode opcode);
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
index abafe47..11571ad 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
@@ -263,7 +263,7 @@ vec4_visitor::try_copy_propagation(vec4_instruction *inst, int arg,
* instructions.
*/
if ((has_source_modifiers || value.file == UNIFORM ||
- value.swizzle != BRW_SWIZZLE_XYZW) && !can_do_source_mods(inst))
+ value.swizzle != BRW_SWIZZLE_XYZW) && !inst->can_do_source_mods(brw))
return false;
if (has_source_modifiers && value.type != inst->src[arg].type)