[Mesa-dev] [PATCH V3 3/7] i965: fs: fix gen6 math operands in one place

Eric Anholt eric at anholt.net
Mon Dec 3 13:56:25 PST 2012


Chris Forbes <chrisf at ijw.co.nz> writes:

> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> ---
>  src/mesa/drivers/dri/i965/brw_fs.cpp | 48 +++++++++++++++++-------------------
>  1 file changed, 23 insertions(+), 25 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> index cc5a790..cdfa46f 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> @@ -864,6 +864,25 @@ fs_visitor::emit_frontfacing_interpolation(ir_variable *ir)
>     return reg;
>  }
>  
> +static fs_reg fix_operand_for_gen6_math(fs_visitor * v, fs_reg src) {

Style notes:

We put that opening brace on the next line.  We tend to (but are not
consistent with) putting the function name on a separate line from its
return type, which lets people git grep ^function_name.

It would be more consistent with everything else to make this be a
method of the visitor instead of taking the visitor as an arg.

> +   /* Can't do hstride == 0 args on gen6 math, so expand it out. We
> +    * might be able to do better by doing execsize = 1 math and then
> +    * expanding that result out, but we would need to be careful with
> +    * masking.

Hah, that note about execsize == 1 is so close to something I've thought
about that I thought I'd written that :)

I like this change overall.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20121203/76cc61bd/attachment.pgp>


More information about the mesa-dev mailing list