r300: Removed goto statement in r300SetupRSUnit.
authorOliver McFadden <z3ro.geek@gmail.com>
Tue, 29 May 2007 05:07:33 +0000 (05:07 +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 b9b1fa7567de756592778ae006f180a0994a9720..8a61167090f7084a5bf0a0d6490ca85e03b3553d 100644 (file)
@@ -1416,45 +1416,40 @@ 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))) {
-                               /* Passing invalid data here can lock the GPU. */
+                       /* Passing invalid data here can lock the GPU. */
+                       if (R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_TEX0 + i, _TNL_ATTRIB_TEX(i))) {
+                               InputsRead &= ~(FRAG_BIT_TEX0 << i);
+                               fp_reg++;
+                       } else {
                                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);
                        }
-                       InputsRead &= ~(FRAG_BIT_TEX0 << i);
-                       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)) {
+               if (R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_COL0, _TNL_ATTRIB_COLOR0)) {
+                       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++;
+               } else {
                        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);
-               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)) {
+               if (R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_COL1, _TNL_ATTRIB_COLOR1)) {
+                       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;
+                       col_interp_nr++;
+               } else {
                        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);
-               InputsRead &= ~FRAG_BIT_COL1;
-               if (high_rr < 1)
-                       high_rr = 1;
-               col_interp_nr++;
        }
 
        /* Need at least one. This might still lock as the values are undefined... */