r300/compiler: Fix R300 fragment program regression introduced by 0723cd1...
authorNicolai Hähnle <nhaehnle@gmail.com>
Sun, 20 Sep 2009 14:33:59 +0000 (16:33 +0200)
committerNicolai Hähnle <nhaehnle@gmail.com>
Sun, 20 Sep 2009 14:34:47 +0000 (16:34 +0200)
We obviously need to move the code addr register backwards because their may
be overlap.

This bug affected in particular the Compiz water plugin.

Signed-off-by: Nicolai Hähnle <nhaehnle@gmail.com>
src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c

index 305dc074ee8c4896bee6e9d2e4c9d69ba61ab3b8..c7227bbd15b881bec9bc014c5735f040528187a8 100644 (file)
@@ -352,7 +352,7 @@ void r300BuildFragmentProgramHwCode(struct r300_fragment_program_compiler *compi
        if (emit.current_node < 3) {
                int shift = 3 - emit.current_node;
                int i;
-               for(i = 0; i <= emit.current_node; ++i)
+               for(i = emit.current_node; i >= 0; --i)
                        code->code_addr[shift + i] = code->code_addr[i];
                for(i = 0; i < shift; ++i)
                        code->code_addr[i] = 0;