summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Cain <[email protected]>2011-06-27 17:25:50 -0500
committerBryan Cain <[email protected]>2011-08-01 17:59:09 -0500
commit4c8b6a286887628e5fc35306189a4c4a83c482ea (patch)
treec1717e77ec6aac47208bac29ca2e2628cf718d36
parentf00406b68c07f97b11e873c04917cafdb1a67462 (diff)
glsl_to_tgsi: fix mistake in new dead code elimination pass
The conditions of IF opcodes were not being counted as reads, which sometimes led to the condition register being wrong or undefined.
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp8
1 files changed, 4 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 e38617ae9fe..f87c64f62c7 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -3315,10 +3315,6 @@ glsl_to_tgsi_visitor::eliminate_dead_code_advanced(void)
memset(writes, 0, sizeof(*writes) * this->next_temp * 4);
break;
- case TGSI_OPCODE_IF:
- ++level;
- break;
-
case TGSI_OPCODE_ENDIF:
--level;
break;
@@ -3341,6 +3337,10 @@ glsl_to_tgsi_visitor::eliminate_dead_code_advanced(void)
}
break;
+ case TGSI_OPCODE_IF:
+ ++level;
+ /* fallthrough to default case to mark the condition as read */
+
default:
/* Continuing the block, clear any channels from the write array that
* are read by this instruction.