r300: Cleaned up r300SetupRSUnit.
authorOliver McFadden <z3ro.geek@gmail.com>
Tue, 29 May 2007 05:02:03 +0000 (05:02 +0000)
committerOliver McFadden <z3ro.geek@gmail.com>
Wed, 30 May 2007 03:19:26 +0000 (03:19 +0000)
src/mesa/drivers/dri/r300/r300_state.c

index 475eed1e9518c42da523bc90708e507b0822f05b..b9b1fa7567de756592778ae006f180a0994a9720 100644 (file)
@@ -1372,11 +1372,9 @@ static void r300SetupRSUnit(GLcontext * ctx)
        int i;
 
        if (hw_tcl_on)
-               OutputsWritten.vp_outputs =
-                   CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten;
+               OutputsWritten.vp_outputs = CURRENT_VERTEX_SHADER(ctx)->key.OutputsWritten;
        else
-               RENDERINPUTS_COPY(OutputsWritten.index_bitset,
-                                 r300->state.render_inputs_bitset);
+               RENDERINPUTS_COPY(OutputsWritten.index_bitset, r300->state.render_inputs_bitset);
 
        if (ctx->FragmentProgram._Current)
                InputsRead = ctx->FragmentProgram._Current->Base.InputsRead;
@@ -1408,9 +1406,7 @@ static void r300SetupRSUnit(GLcontext * ctx)
        }
 
        for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
-               r300->hw.ri.cmd[R300_RI_INTERP_0 + i] = 0
-                   | R300_RS_INTERP_USED
-                   | (in_texcoords << R300_RS_INTERP_SRC_SHIFT)
+               r300->hw.ri.cmd[R300_RI_INTERP_0 + i] = 0 | R300_RS_INTERP_USED | (in_texcoords << R300_RS_INTERP_SRC_SHIFT)
                    | interp_magic[i];
 
                r300->hw.rr.cmd[R300_RR_ROUTE_0 + fp_reg] = 0;
@@ -1420,13 +1416,9 @@ static void r300SetupRSUnit(GLcontext * ctx)
                            | (fp_reg << R300_RS_ROUTE_DEST_SHIFT);
                        high_rr = fp_reg;
 
-                       if (!R300_OUTPUTS_WRITTEN_TEST
-                           (OutputsWritten, VERT_RESULT_TEX0 + i,
-                            _TNL_ATTRIB_TEX(i))) {
+                       if (!R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_TEX0 + i, _TNL_ATTRIB_TEX(i))) {
                                /* Passing invalid data here can lock the GPU. */
-                               WARN_ONCE
-                                   ("fragprog wants coords for tex%d, vp doesn't provide them!\n",
-                                    i);
+                               WARN_ONCE("fragprog wants coords for tex%d, vp doesn't provide them!\n", i);
                                //_mesa_print_program(&CURRENT_VERTEX_SHADER(ctx)->Base);
                                //_mesa_exit(-1);
                        }
@@ -1434,40 +1426,31 @@ static void r300SetupRSUnit(GLcontext * ctx)
                        fp_reg++;
                }
                /* Need to count all coords enabled at vof */
-               if (R300_OUTPUTS_WRITTEN_TEST
-                   (OutputsWritten, VERT_RESULT_TEX0 + i, _TNL_ATTRIB_TEX(i)))
+               if (R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_TEX0 + i, _TNL_ATTRIB_TEX(i)))
                        in_texcoords++;
        }
 
        if (InputsRead & FRAG_BIT_COL0) {
-               if (!R300_OUTPUTS_WRITTEN_TEST
-                   (OutputsWritten, VERT_RESULT_COL0, _TNL_ATTRIB_COLOR0)) {
-                       WARN_ONCE
-                           ("fragprog wants col0, vp doesn't provide it\n");
+               if (!R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_COL0, _TNL_ATTRIB_COLOR0)) {
+                       WARN_ONCE("fragprog wants col0, vp doesn't provide it\n");
                        goto out;       /* FIXME */
                        //_mesa_print_program(&CURRENT_VERTEX_SHADER(ctx)->Base);
                        //_mesa_exit(-1);
                }
 
-               r300->hw.rr.cmd[R300_RR_ROUTE_0] |= 0
-                   | R300_RS_ROUTE_0_COLOR
-                   | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT);
+               r300->hw.rr.cmd[R300_RR_ROUTE_0] |= 0 | R300_RS_ROUTE_0_COLOR | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT);
                InputsRead &= ~FRAG_BIT_COL0;
                col_interp_nr++;
        }
       out:
 
        if (InputsRead & FRAG_BIT_COL1) {
-               if (!R300_OUTPUTS_WRITTEN_TEST
-                   (OutputsWritten, VERT_RESULT_COL1, _TNL_ATTRIB_COLOR1)) {
-                       WARN_ONCE
-                           ("fragprog wants col1, vp doesn't provide it\n");
+               if (!R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_COL1, _TNL_ATTRIB_COLOR1)) {
+                       WARN_ONCE("fragprog wants col1, vp doesn't provide it\n");
                        //_mesa_exit(-1);
                }
 
-               r300->hw.rr.cmd[R300_RR_ROUTE_1] |=
-                   R300_RS_ROUTE_1_UNKNOWN11 | R300_RS_ROUTE_1_COLOR1 |
-                   (fp_reg++ << R300_RS_ROUTE_1_COLOR1_DEST_SHIFT);
+               r300->hw.rr.cmd[R300_RR_ROUTE_1] |= R300_RS_ROUTE_1_UNKNOWN11 | R300_RS_ROUTE_1_COLOR1 | (fp_reg++ << R300_RS_ROUTE_1_COLOR1_DEST_SHIFT);
                InputsRead &= ~FRAG_BIT_COL1;
                if (high_rr < 1)
                        high_rr = 1;
@@ -1476,9 +1459,7 @@ static void r300SetupRSUnit(GLcontext * ctx)
 
        /* Need at least one. This might still lock as the values are undefined... */
        if (in_texcoords == 0 && col_interp_nr == 0) {
-               r300->hw.rr.cmd[R300_RR_ROUTE_0] |= 0
-                   | R300_RS_ROUTE_0_COLOR
-                   | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT);
+               r300->hw.rr.cmd[R300_RR_ROUTE_0] |= 0 | R300_RS_ROUTE_0_COLOR | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT);
                col_interp_nr++;
        }
 
@@ -1487,13 +1468,11 @@ static void r300SetupRSUnit(GLcontext * ctx)
            | R300_RS_CNTL_0_UNKNOWN_18;
 
        assert(high_rr >= 0);
-       r300->hw.rr.cmd[R300_RR_CMD_0] =
-           cmdpacket0(R300_RS_ROUTE_0, high_rr + 1);
+       r300->hw.rr.cmd[R300_RR_CMD_0] = cmdpacket0(R300_RS_ROUTE_0, high_rr + 1);
        r300->hw.rc.cmd[2] = 0xC0 | high_rr;
 
        if (InputsRead)
-               WARN_ONCE("Don't know how to satisfy InputsRead=0x%08x\n",
-                         InputsRead);
+               WARN_ONCE("Don't know how to satisfy InputsRead=0x%08x\n", InputsRead);
 }
 
 #define bump_vpu_count(ptr, new_count)   do{\