r500: some trivial fixups to get tri working.

the counter was being used one instruction over the end
This commit is contained in:
Dave Airlie 2008-05-15 13:21:50 +10:00
parent 375656440b
commit 10e0a36a49
2 changed files with 14 additions and 10 deletions

View file

@ -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 |

View file

@ -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;