r300: fix compiler bugs introduced with MRT changes.
authorDave Airlie <airlied@redhat.com>
Wed, 3 Feb 2010 08:56:40 +0000 (18:56 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 3 Feb 2010 08:58:11 +0000 (18:58 +1000)
the first looks like a definite bug, the second I'm not so confident
of but it works.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c
src/mesa/drivers/dri/r300/r300_fragprog_common.c

index 80cc5ffe9555de40a22d9f976b680e1bc4de3ab9..fff5b0c21735a5158f96e8fc4c80429b56721856 100644 (file)
@@ -208,8 +208,8 @@ static void set_pair_instruction(struct r300_fragment_program_compiler *c,
         } else {
             for (i = 0; i < 4; i++) {
                 if (inst->DstReg.Index == c->OutputColor[i]) {
-                    pair->RGB.Target = inst->DstReg.Index;
-                    pair->Alpha.Target = inst->DstReg.Index;
+                    pair->RGB.Target = i;
+                    pair->Alpha.Target = i;
                     pair->RGB.OutputWriteMask |=
                         inst->DstReg.WriteMask & RC_MASK_XYZ;
                     pair->Alpha.OutputWriteMask |=
index 3ec43e62bd9ace1f2abd944ed38e6a90ff85ca6e..a0e2dd3c09f3dd60c339f405e9018c36c5f60dae 100644 (file)
@@ -221,6 +221,7 @@ static void translate_fragment_program(GLcontext *ctx, struct r300_fragment_prog
        compiler.state = fp->state;
        compiler.is_r500 = (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) ? GL_TRUE : GL_FALSE;
        compiler.OutputDepth = FRAG_RESULT_DEPTH;
+       memset(compiler.OutputColor, 0, 4 * sizeof(unsigned));
        compiler.OutputColor[0] = FRAG_RESULT_COLOR;
        compiler.AllocateHwInputs = &allocate_hw_inputs;