Merge branch 'r345-cleanup' of git://people.freedesktop.org/~agd5f/mesa into r500test
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Fri, 2 May 2008 22:57:57 +0000 (15:57 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Fri, 2 May 2008 22:57:57 +0000 (15:57 -0700)
Adding Alex's cleanup patches. This adds r5xx TCL! Whoo-hoo!
Conflicts:

src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/radeon/radeon_chipset.h
src/mesa/drivers/dri/radeon/radeon_screen.c

1  2 
src/mesa/drivers/dri/r300/r300_state.c

index dac37ba27357d1ec9647e4c47a0764feb037c4f2,89a0827b2fc06aacf2e3e73d656c6b0067b2cc23..d596a0b9c4ec0ba6f469bbe6d96b6260a6f8096a
@@@ -2319,29 -2354,51 +2354,30 @@@ static void r500SetupPixelShader(r300Co
            (char *)ctx->FragmentProgram._Current;
        int i, k;
  
 -      if (!fp)                /* should only happenen once, just after context is created */
 +      if (!fp)        /* should only happen once, just after context is created */
                return;
  
 -      /* emit the standard zero shader */
 +      r500TranslateFragmentShader(rmesa, fp);
 +      if (!fp->translated) {
 +              fprintf(stderr, "%s: No valid fragment shader, exiting\n",
 +                      __FUNCTION__);
 +              return;
 +      }
 +
        R300_STATECHANGE(rmesa, r500fp);
 -      i = 1;
 -      rmesa->hw.r500fp.cmd[i++] = R500_INST_TYPE_OUT |
 -              R500_INST_TEX_SEM_WAIT |
 -              R500_INST_LAST |
 -              R500_INST_RGB_OMASK_R |
 -              R500_INST_RGB_OMASK_G |
 -              R500_INST_RGB_OMASK_B |
 -              R500_INST_ALPHA_OMASK;
 -
 -      rmesa->hw.r500fp.cmd[i++] = R500_RGB_ADDR0(0) |
 -              R500_RGB_ADDR1(0) |
 -              R500_RGB_ADDR1_CONST |
 -              R500_RGB_ADDR2(0) |
 -              R500_RGB_ADDR2_CONST |
 -              R500_RGB_SRCP_OP_1_MINUS_2RGB0;
 -      rmesa->hw.r500fp.cmd[i++] = R500_ALPHA_ADDR0(0) |
 -              R500_ALPHA_ADDR1(0) |
 -              R500_ALPHA_ADDR1_CONST |
 -              R500_ALPHA_ADDR2(0) |
 -              R500_ALPHA_ADDR2_CONST |
 -              R500_ALPHA_SRCP_OP_1_MINUS_2A0;
 -      rmesa->hw.r500fp.cmd[i++] = R500_ALU_RGB_SEL_A_SRC0 |
 -              R500_ALU_RGB_R_SWIZ_A_R |
 -              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;
 -      rmesa->hw.r500fp.cmd[i++] = R500_ALPHA_OP_MAD |
 -              R500_ALPHA_SWIZ_A_A |
 -              R500_ALPHA_SWIZ_B_1;
 -      rmesa->hw.r500fp.cmd[i++] = R500_ALU_RGBA_OP_MAD |
 -              R500_ALU_RGBA_R_SWIZ_0 |
 -              R500_ALU_RGBA_G_SWIZ_0 |
 -              R500_ALU_RGBA_B_SWIZ_0 |
 -              R500_ALU_RGBA_A_SWIZ_0;
 -
 -      bump_r500fp_count(rmesa->hw.r500fp.cmd, 6);
 +      /* Emit our shader... */
 +      for (i = 0; i < fp->cs->nrslots; i++) {
 +              rmesa->hw.r500fp.cmd[i*6+1] = fp->inst[i].inst0;
 +              rmesa->hw.r500fp.cmd[i*6+2] = fp->inst[i].inst1;
 +              rmesa->hw.r500fp.cmd[i*6+3] = fp->inst[i].inst2;
 +              rmesa->hw.r500fp.cmd[i*6+4] = fp->inst[i].inst3;
 +              rmesa->hw.r500fp.cmd[i*6+5] = fp->inst[i].inst4;
 +              rmesa->hw.r500fp.cmd[i*6+6] = fp->inst[i].inst5;
 +      }
 +
 +      bump_r500fp_count(rmesa->hw.r500fp.cmd, fp->cs->nrslots * 6);
 +
        R300_STATECHANGE(rmesa, r500fp_const);
        for (i = 0; i < fp->const_nr; i++) {
                rmesa->hw.r500fp_const.cmd[R300_FPP_PARAM_0 + 4 * i + 0] = r300PackFloat24(fp->constant[i][0]);