[Mesa-dev] [PATCH 12/12] nir/glsl: Propagate invariant into NIR alu ops

Francisco Jerez currojerez at riseup.net
Fri Mar 18 21:44:24 UTC 2016


Jason Ekstrand <jason at jlekstrand.net> writes:

> ---
>  src/compiler/nir/glsl_to_nir.cpp | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/src/compiler/nir/glsl_to_nir.cpp b/src/compiler/nir/glsl_to_nir.cpp
> index 613b138..f592c57 100644
> --- a/src/compiler/nir/glsl_to_nir.cpp
> +++ b/src/compiler/nir/glsl_to_nir.cpp
> @@ -1048,6 +1048,8 @@ nir_visitor::visit(ir_assignment *ir)
>  {
>     unsigned num_components = ir->lhs->type->vector_elements;
>  
> +   b.exact = ir->lhs->variable_referenced()->data.invariant;
> +

Wouldn't it make sense to set the exact flag for precise as well?

With that fixed:

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

>     if ((ir->rhs->as_dereference() || ir->rhs->as_constant()) &&
>         (ir->write_mask == (1 << num_components) - 1 || ir->write_mask == 0)) {
>        /* We're doing a plain-as-can-be copy, so emit a copy_var */
> -- 
> 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/7acc51fb/attachment.sig>


More information about the mesa-dev mailing list