From: Benjamin Segovia Date: Tue, 17 Aug 2010 03:40:09 +0000 (-0700) Subject: prog_optimize: Only merge writes to temporary registers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5a38e70d59eb54aa375fb0f19c824bb74b71486d;p=mesa.git 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. --- 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;