[Mesa-dev] [PATCH V4 5/6] i965/fs: Skip channel expressions splitting for interpolation

Kenneth Graunke kenneth at whitecape.org
Fri Jul 11 23:57:26 PDT 2014


On Saturday, July 12, 2014 03:20:14 PM Chris Forbes wrote:
> The backend will have to do a message send, so we want to keep these in
> one piece, just like texture ops.
> 
> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
> ---
>  .../dri/i965/brw_fs_channel_expressions.cpp        | 25 
++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp 
b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
> index 9fe0ffc..4113f47 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_channel_expressions.cpp
> @@ -75,6 +75,18 @@ channel_expressions_predicate(ir_instruction *ir)
>     if (!expr)
>        return false;
>  
> +   switch (expr->operation) {
> +      /* these opcodes need to act on the whole vector,
> +       * just like texturing.
> +       */
> +      case ir_unop_interpolate_at_centroid:
> +      case ir_binop_interpolate_at_offset:
> +      case ir_binop_interpolate_at_sample:
> +         return false;
> +      default:
> +         break;
> +   }
> +
>     for (i = 0; i < expr->get_num_operands(); i++) {
>        if (expr->operands[i]->type->is_vector())
>  	 return true;
> @@ -153,6 +165,16 @@ 
ir_channel_expressions_visitor::visit_leave(ir_assignment *ir)
>     if (!found_vector)
>        return visit_continue;
>  
> +   switch (expr->operation) {
> +      case ir_unop_interpolate_at_centroid:
> +      case ir_binop_interpolate_at_offset:
> +      case ir_binop_interpolate_at_sample:
> +         return visit_continue;
> +
> +      default:
> +         break;
> +   }
> +
>     /* Store the expression operands in temps so we can use them
>      * multiple times.
>      */
> @@ -414,6 +436,9 @@ 
ir_channel_expressions_visitor::visit_leave(ir_assignment *ir)
>     case ir_unop_unpack_half_2x16_split_x:
>     case ir_unop_unpack_half_2x16_split_y:
>     case ir_binop_pack_half_2x16_split:
> +   case ir_unop_interpolate_at_centroid:
> +   case ir_binop_interpolate_at_offset:
> +   case ir_binop_interpolate_at_sample:
>        unreachable("not reached: expression operates on scalars only");
>     }
>  
> 

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140711/5593abbf/attachment-0001.sig>


More information about the mesa-dev mailing list