[Mesa-dev] [PATCH 08/17] intel/compiler/fs: Fix application of cmod and saturate to LINE/MAC pair

Kenneth Graunke kenneth at whitecape.org
Sat Feb 24 00:15:25 UTC 2018


On Tuesday, February 20, 2018 9:15:15 PM PST Matt Turner wrote:
> ---
>  src/intel/compiler/brw_fs_generator.cpp | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/src/intel/compiler/brw_fs_generator.cpp b/src/intel/compiler/brw_fs_generator.cpp
> index 0854709b272..f2bdac7d731 100644
> --- a/src/intel/compiler/brw_fs_generator.cpp
> +++ b/src/intel/compiler/brw_fs_generator.cpp
> @@ -673,6 +673,7 @@ fs_generator::generate_linterp(fs_inst *inst,
>     struct brw_reg delta_x = src[0];
>     struct brw_reg delta_y = offset(src[0], inst->exec_size / 8);
>     struct brw_reg interp = src[1];
> +   brw_inst *i[2];
>  
>     if (devinfo->gen >= 11) {
>        struct brw_reg acc = retype(brw_acc_reg(8), BRW_REGISTER_TYPE_NF);
> @@ -727,11 +728,19 @@ fs_generator::generate_linterp(fs_inst *inst,
>  
>        return false;
>     } else {
> -      brw_LINE(p, brw_null_reg(), interp, delta_x);
> -      brw_MAC(p, dst, suboffset(interp, 1), delta_y);
> -
> -      return true;
> +      i[0] = brw_LINE(p, brw_null_reg(), interp, delta_x);
> +      i[1] = brw_MAC(p, dst, suboffset(interp, 1), delta_y);
>     }
> +
> +   brw_inst_set_cond_modifier(p->devinfo, i[1], inst->conditional_mod);
> +
> +   /* brw_set_default_saturate() is called before emitting instructions, so the
> +    * saturate bit is set in each instruction, so we need to unset it on the
> +    * first instruction.
> +    */
> +   brw_inst_set_saturate(p->devinfo, i[0], false);
> +
> +   return true;
>  }
>  
>  void
> 

I really need to keep reading.  The next patch fixes the thing I was
complaining about.  Sorry about that.  With this ordering, patch 7
will break LINE/MAC and patch 8 will fix it...so at least that much
needs changing.

I'm fine with handling this explicitly, so it's:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

but we could also just...not...if we drop the
multiple_instructions_emitted stuff.  Not sure which is better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180223/04945ee1/attachment.sig>


More information about the mesa-dev mailing list