summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-08-16 16:30:52 -0600
committerBrian Paul <[email protected]>2011-08-17 08:12:54 -0600
commit718b894dbb585af52dd24defb2e8c130216e5485 (patch)
tree765f62f736bd86190e2bd6ba89269743f538fe1a /src/mesa
parent65bdb878a0afcdffe51716ae4533a04990c7d556 (diff)
st/mesa: fix incorrect loop over instruction src regs
The array of src regs is of size 3, not 4.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_glsl_to_tgsi.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index aef23e7d207..7b90c812595 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -3443,7 +3443,7 @@ glsl_to_tgsi_visitor::eliminate_dead_code_advanced(void)
/* Continuing the block, clear any channels from the write array that
* are read by this instruction.
*/
- for (int i = 0; i < 4; i++) {
+ for (unsigned i = 0; i < Elements(inst->src); i++) {
if (inst->src[i].file == PROGRAM_TEMPORARY && inst->src[i].reladdr){
/* Any temporary might be read, so no dead code elimination
* across this instruction.