summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Cain <bryancain3@gmail.com>2011-04-30 13:44:32 -0500
committerBryan Cain <bryancain3@gmail.com>2011-08-01 17:59:07 -0500
commit556bd82ce1227a568d69dfa0c22841986267d39f (patch)
tree9530b97bb5de3c257b7cf6d4bb54175e46d84e01
parentc341d3cfd0ddbabf6274212b7f0da1a25854a673 (diff)
glsl_to_tgsi: remove a bad assertion
It was triggered by Alien Arena.
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 5ea03b4424e..aa63539e5e8 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -3077,11 +3077,11 @@ glsl_to_tgsi_visitor::merge_registers(void)
/* Start looking for registers with non-overlapping usages that can be
* merged together. */
- for (i=0; i < this->next_temp - 1; i++) {
+ for (i=0; i < this->next_temp; i++) {
/* Don't touch unused registers. */
if (last_reads[i] < 0 || first_writes[i] < 0) continue;
- for (j=i+1; j < this->next_temp; j++) {
+ for (j=0; j < this->next_temp; j++) {
/* Don't touch unused registers. */
if (last_reads[j] < 0 || first_writes[j] < 0) continue;
@@ -3089,8 +3089,9 @@ glsl_to_tgsi_visitor::merge_registers(void)
* in the same instruction as the last read from i. Note that the
* register at index i will always be used earlier or at the same time
* as the register at index j. */
- assert(first_writes[i] <= first_writes[j]);
- if (last_reads[i] <= first_writes[j]) {
+ if (first_writes[i] <= first_writes[j] &&
+ last_reads[i] <= first_writes[j])
+ {
rename_temp_register(j, i); /* Replace all references to j with i.*/
/* Update the first_writes and last_reads arrays with the new