On Tuesday, June 24, 2014 12:16:49 PM Matt Turner wrote:
> Pretty nonsensical to have it as a method of the visitor just for access
> to brw.
> ---
> src/mesa/drivers/dri/i965/brw_fs.cpp | 8 ++++----
> src/mesa/drivers/dri/i965/brw_fs.h | 3 +--
> src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp | 2 +-
> src/mesa/drivers/dri/i965/brw_vec4.cpp | 8 ++++----
> src/mesa/drivers/dri/i965/brw_vec4.h | 3 +--
> src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp | 2 +-
> 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;I really like this. A good follow-on, IMHO, would be to make backend_instruction::can_do_source_mods() protected, rather than public. That way, fs_inst and vec4_instruction methods could use it (as you do here), but other code couldn't call it directly (accidentally bypassing the FS/Vec4 specific details). Series looks great. I'd forgotten about adding math support for constant propagation. Nice catch. Reviewed-by: Kenneth Graunke <[email protected]>
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
