Mesa (master): r300: fix compiler bugs introduced with MRT changes.

Dave Airlie airlied at kemper.freedesktop.org
Wed Feb 3 09:00:13 UTC 2010


Module: Mesa
Branch: master
Commit: f9d734c309ca044fc70dc79eafe32b12460d65c0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f9d734c309ca044fc70dc79eafe32b12460d65c0

Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Feb  3 18:56:40 2010 +1000

r300: fix compiler bugs introduced with MRT changes.

the first looks like a definite bug, the second I'm not so confident
of but it works.

Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 .../dri/r300/compiler/radeon_pair_translate.c      |    4 ++--
 src/mesa/drivers/dri/r300/r300_fragprog_common.c   |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c
index 80cc5ff..fff5b0c 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c
@@ -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 |=
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c
index 3ec43e6..a0e2dd3 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c
+++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c
@@ -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;
 




More information about the mesa-commit mailing list