From 10e0a36a496a7032b15728343cf8ee2ca2df5cb3 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 15 May 2008 13:21:50 +1000 Subject: [PATCH] r500: some trivial fixups to get tri working. the counter was being used one instruction over the end --- src/mesa/drivers/dri/r300/r300_ioctl.c | 18 +++++++++++------- src/mesa/drivers/dri/r300/r500_fragprog.c | 6 +++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c index 9c46cc795f8..b6d600d40a9 100644 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ b/src/mesa/drivers/dri/r300/r300_ioctl.c @@ -305,7 +305,7 @@ static void r300EmitClearState(GLcontext * ctx) R300_STATECHANGE(r300, rr); reg_start(R300_RS_INST_0, 0); - e32(R500_RS_INST_COL_CN_WRITE); + e32(R300_RS_INST_COL_CN_WRITE); } else { R300_STATECHANGE(r300, ri); @@ -357,6 +357,10 @@ static void r300EmitClearState(GLcontext * ctx) reg_start(R300_US_ALU_ALPHA_ADDR_0, 0); e32(FP_SELA(0, NO, W, FP_TMP(0), 0, 0)); } else { + R300_STATECHANGE(r300, fp); + reg_start(R500_US_PIXSIZE, 0); + e32(0x2); + R300_STATECHANGE(r300, r500fp); r500fp_start_fragment(0, 6); @@ -387,15 +391,15 @@ static void r300EmitClearState(GLcontext * ctx) R500_ALU_RGB_G_SWIZ_A_G | R500_ALU_RGB_B_SWIZ_A_B | R500_ALU_RGB_SEL_B_SRC0 | - R500_ALU_RGB_R_SWIZ_B_1 | - R500_ALU_RGB_B_SWIZ_B_1 | - R500_ALU_RGB_G_SWIZ_B_1); + R500_ALU_RGB_R_SWIZ_B_R | + R500_ALU_RGB_B_SWIZ_B_G | + R500_ALU_RGB_G_SWIZ_B_B); - e32(R500_ALPHA_OP_MAD | + e32(R500_ALPHA_OP_CMP | R500_ALPHA_SWIZ_A_A | - R500_ALPHA_SWIZ_B_1); + R500_ALPHA_SWIZ_B_A); - e32(R500_ALU_RGBA_OP_MAD | + e32(R500_ALU_RGBA_OP_CMP | R500_ALU_RGBA_R_SWIZ_0 | R500_ALU_RGBA_G_SWIZ_0 | R500_ALU_RGBA_B_SWIZ_0 | diff --git a/src/mesa/drivers/dri/r300/r500_fragprog.c b/src/mesa/drivers/dri/r300/r500_fragprog.c index f9ef582d0a5..2ea77bcfade 100644 --- a/src/mesa/drivers/dri/r300/r500_fragprog.c +++ b/src/mesa/drivers/dri/r300/r500_fragprog.c @@ -601,12 +601,11 @@ static GLboolean parse_program(struct r500_fragment_program *fp) } /* Finish him! (If it's an ALU/OUT instruction...) */ - if ((fp->inst[counter].inst0 & 0x3) ^ 0x2) { - fp->inst[counter].inst0 |= R500_INST_TYPE_OUT + if ((fp->inst[counter-1].inst0 & 0x3) <= 1) { + fp->inst[counter-1].inst0 |= R500_INST_TYPE_OUT | R500_INST_TEX_SEM_WAIT | R500_INST_LAST; } else { /* We still need to put an output inst, right? */ - counter++; fp->inst[counter].inst0 = R500_INST_TYPE_OUT | R500_INST_TEX_SEM_WAIT | R500_INST_LAST | R500_INST_RGB_OMASK_R | R500_INST_RGB_OMASK_G @@ -625,6 +624,7 @@ static GLboolean parse_program(struct r500_fragment_program *fp) | R500_ALU_RGBA_ADDRD(0) | MAKE_SWIZ_RGBA_C(R500_SWIZ_RGB_ZERO) | MAKE_SWIZ_ALPHA_C(R500_SWIZZLE_ZERO); + counter++; } fp->cs->nrslots = counter; -- 2.30.2