summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Segovia <[email protected]>2010-08-16 20:40:09 -0700
committerIan Romanick <[email protected]>2010-08-17 14:57:18 -0700
commit5a38e70d59eb54aa375fb0f19c824bb74b71486d (patch)
tree7e1bd1f7fe23a197f86316938ef6caea445e4542
parent608f749ec3fc655d3e67e572fa2e256a42c16878 (diff)
prog_optimize: Only merge writes to temporary registers
In one optimization pass, register files may have been messed therefore merging instructions which use the same index in two different register files.
-rw-r--r--src/mesa/program/prog_optimize.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/program/prog_optimize.c b/src/mesa/program/prog_optimize.c
index ab878755e25..0dc779073db 100644
--- a/src/mesa/program/prog_optimize.c
+++ b/src/mesa/program/prog_optimize.c
@@ -758,7 +758,11 @@ _mesa_remove_extra_moves(struct gl_program *prog)
nesting--;
break;
case OPCODE_MOV:
- if (i > 0 && can_downward_mov_be_modifed(mov) && nesting == 0) {
+ if (i > 0 &&
+ can_downward_mov_be_modifed(mov) &&
+ mov->SrcReg[0].File == PROGRAM_TEMPORARY &&
+ nesting == 0)
+ {
/* see if this MOV can be removed */
const GLuint id = mov->SrcReg[0].Index;