[Mesa-dev] [PATCH 15/21] i965: Define consistent interface to predicate an instruction.

Matt Turner mattst88 at gmail.com
Wed Apr 29 22:53:18 PDT 2015


On Tue, Apr 28, 2015 at 10:08 AM, Francisco Jerez <currojerez at riseup.net> wrote:
> ---
>  src/mesa/drivers/dri/i965/brw_ir_fs.h    | 22 ++++++++++++++++++++++
>  src/mesa/drivers/dri/i965/brw_ir_svec4.h | 26 ++++++++++++++++++++++++++
>  src/mesa/drivers/dri/i965/brw_ir_vec4.h  | 22 ++++++++++++++++++++++
>  3 files changed, 70 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_ir_fs.h b/src/mesa/drivers/dri/i965/brw_ir_fs.h
> index 1bbe164..b2dfa00 100644
> --- a/src/mesa/drivers/dri/i965/brw_ir_fs.h
> +++ b/src/mesa/drivers/dri/i965/brw_ir_fs.h
> @@ -329,4 +329,26 @@ exec_all(fs_inst *inst)
>     return inst;
>  }
>
> +/**
> + * Make the execution of \p inst dependent on the evaluation of a possibly
> + * inverted predicate.
> + */
> +static inline fs_inst *
> +exec_predicate_inv(enum brw_predicate pred, bool inverse,
> +                   fs_inst *inst)

Is the order of the parameters for a particular reason? If not, I'd
much rather this be

exec_predicate_inv(fs_inst *inst, enum brw_predicate pred, bool inverse = false)

since it feels more natural for inst to be first, and
predicate-inverse is almost never true unless you start doing that a
lot in later patches.


More information about the mesa-dev mailing list