[Mesa-dev] [PATCH 11/12] glsl/rebalance_tree: Don't handle invariant or precise trees

Francisco Jerez currojerez at riseup.net
Fri Mar 18 21:41:02 UTC 2016


Jason Ekstrand <jason at jlekstrand.net> writes:

> ---
>  src/compiler/glsl/opt_rebalance_tree.cpp | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/src/compiler/glsl/opt_rebalance_tree.cpp b/src/compiler/glsl/opt_rebalance_tree.cpp
> index 095f2d7..8045d51 100644
> --- a/src/compiler/glsl/opt_rebalance_tree.cpp
> +++ b/src/compiler/glsl/opt_rebalance_tree.cpp
> @@ -131,6 +131,8 @@ public:
>        progress = false;
>     }
>  
> +   virtual ir_visitor_status visit_enter(ir_assignment *ir);
> +
>     void handle_rvalue(ir_rvalue **rvalue);
>  
>     bool progress;
> @@ -146,6 +148,20 @@ struct is_reduction_data {
>  
>  } /* anonymous namespace */
>  
> +ir_visitor_status
> +ir_rebalance_visitor::visit_enter(ir_assignment *ir)
> +{
> +   ir_variable *var = ir->lhs->variable_referenced();
> +   if (var->data.invariant || var->data.precise) {
> +      /* If we're assigning to an invariant variable, just bail.  Tree
> +       * rebalancing (reassociation) isn't precision-safe.
> +       */
> +      return visit_continue_with_parent;
> +   } else {
> +      return visit_continue;
> +   }
> +}
> +

Reviewed-by: Francisco Jerez <currojerez at riseup.net>

>  static bool
>  is_reduction_operation(ir_expression_operation operation)
>  {
> -- 
> 2.5.0.400.gff86faf
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160318/9c30a88a/attachment.sig>


More information about the mesa-dev mailing list