summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-03-17 15:20:20 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2016-03-23 16:28:07 -0700
commita984e44abde74bd17ae2b0ef0762da3f63d84483 (patch)
treed8bad9ac0017b41911cccce0d6f815d7e2c3ada7
parent028d6ecfe0feecd1e543322d2953bef810f13d23 (diff)
nir/glsl: Propagate invariant into NIR alu ops
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
-rw-r--r--src/compiler/nir/glsl_to_nir.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler/nir/glsl_to_nir.cpp b/src/compiler/nir/glsl_to_nir.cpp
index ee9c05308d..f6e1a17a91 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 */