[Mesa-dev] [PATCH 09/16] mesa: Slightly change instruction walking behavior for prog_optimize.
Eric Anholt
eric at anholt.net
Wed May 28 11:37:40 PDT 2014
I was going to change this when I moved to lists of instructions, and
wanted to call the behavior change out here. Note that the last
instruction is always OPCODE_END, and can_upward_mov_be_modified will
notice that it's not a MOV and take the continue path (to the exit of the
loop).
---
src/mesa/program/prog_optimize.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/mesa/program/prog_optimize.c b/src/mesa/program/prog_optimize.c
index e877497..ce53937 100644
--- a/src/mesa/program/prog_optimize.c
+++ b/src/mesa/program/prog_optimize.c
@@ -509,7 +509,7 @@ _mesa_remove_extra_move_use(struct gl_program *prog)
* FOO tmpY, arg0, arg1;
*/
- for (i = 0; i + 1 < prog->NumInstructions; i++) {
+ for (i = 0; i < prog->NumInstructions; i++) {
const struct prog_instruction *mov = prog->Instructions + i;
GLuint dst_mask, src_mask;
if (can_upward_mov_be_modifed(mov) == GL_FALSE)
--
2.0.0.rc2
More information about the mesa-dev
mailing list