From a984e44abde74bd17ae2b0ef0762da3f63d84483 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 17 Mar 2016 15:20:20 -0700 Subject: [PATCH] nir/glsl: Propagate invariant into NIR alu ops Reviewed-by: Francisco Jerez --- src/compiler/nir/glsl_to_nir.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/compiler/nir/glsl_to_nir.cpp b/src/compiler/nir/glsl_to_nir.cpp index ee9c05308d6..f6e1a17a916 100644 --- a/src/compiler/nir/glsl_to_nir.cpp +++ b/src/compiler/nir/glsl_to_nir.cpp @@ -1051,6 +1051,9 @@ nir_visitor::visit(ir_assignment *ir) { unsigned num_components = ir->lhs->type->vector_elements; + b.exact = ir->lhs->variable_referenced()->data.invariant || + ir->lhs->variable_referenced()->data.precise; + 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.30.2