diff options
author | marha <marha@users.sourceforge.net> | 2011-07-07 08:37:48 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-07-07 08:37:48 +0200 |
commit | dbe01a4f78f09723b327d1d8522bfa5026c4f6e0 (patch) | |
tree | 8b770c826cf9f64cb61ff3efd1c2f01aeb2dc8c9 /mesalib/src/glsl/opt_constant_propagation.cpp | |
parent | d5eff0b8affe3bfa3d42f54f82d03ba3c0f3e826 (diff) | |
parent | 47a6ae678489d7082b5d7da35d1a92b4233fb5eb (diff) | |
download | vcxsrv-dbe01a4f78f09723b327d1d8522bfa5026c4f6e0.tar.gz vcxsrv-dbe01a4f78f09723b327d1d8522bfa5026c4f6e0.tar.bz2 vcxsrv-dbe01a4f78f09723b327d1d8522bfa5026c4f6e0.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/src/glsl/ir_print_visitor.cpp
mesalib/src/glsl/linker.cpp
mesalib/src/glsl/opt_constant_propagation.cpp
mesalib/src/mesa/program/ir_to_mesa.cpp
Diffstat (limited to 'mesalib/src/glsl/opt_constant_propagation.cpp')
-rw-r--r-- | mesalib/src/glsl/opt_constant_propagation.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/mesalib/src/glsl/opt_constant_propagation.cpp b/mesalib/src/glsl/opt_constant_propagation.cpp index 55c271200..7c42b6191 100644 --- a/mesalib/src/glsl/opt_constant_propagation.cpp +++ b/mesalib/src/glsl/opt_constant_propagation.cpp @@ -51,11 +51,23 @@ public: this->var = var;
this->write_mask = write_mask;
this->constant = constant;
+ this->initial_values = write_mask;
+ }
+
+ acp_entry(const acp_entry *src)
+ {
+ this->var = src->var;
+ this->write_mask = src->write_mask;
+ this->constant = src->constant;
+ this->initial_values = src->initial_values;
}
ir_variable *var;
ir_constant *constant;
unsigned write_mask;
+
+ /** Mask of values initially available in the constant. */
+ unsigned initial_values;
};
@@ -172,7 +184,7 @@ ir_constant_propagation_visitor::handle_rvalue(ir_rvalue **rvalue) for (int j = 0; j < 4; j++) {
if (j == channel)
break;
- if (found->write_mask & (1 << j))
+ if (found->initial_values & (1 << j))
rhs_channel++;
}
@@ -285,8 +297,7 @@ ir_constant_propagation_visitor::handle_if_block(exec_list *instructions) /* Populate the initial acp with a constant of the original */
foreach_iter(exec_list_iterator, iter, *orig_acp) {
acp_entry *a = (acp_entry *)iter.get();
- this->acp->push_tail(new(this->mem_ctx) acp_entry(a->var, a->write_mask,
- a->constant));
+ this->acp->push_tail(new(this->mem_ctx) acp_entry(a));
}
visit_list_elements(this, instructions);
|