[Mesa-dev] [PATCH 12/12] nir/glsl: Propagate invariant into NIR alu ops
Jason Ekstrand
jason at jlekstrand.net
Fri Mar 18 00:51:56 UTC 2016
---
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;
+
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
More information about the mesa-dev
mailing list