r300: finish conversion of RS_INST regs
authorDave Airlie <airlied@redhat.com>
Fri, 28 Mar 2008 02:16:33 +0000 (13:16 +1100)
committerDave Airlie <airlied@redhat.com>
Fri, 28 Mar 2008 02:16:33 +0000 (13:16 +1100)
src/mesa/drivers/dri/r300/r300_ioctl.c
src/mesa/drivers/dri/r300/r300_reg.h
src/mesa/drivers/dri/r300/r300_state.c

index a678922ae2102ce06664c6e8fc65ce91456637b4..bc2c50918082e8e50400218a4a6df91312949d4c 100644 (file)
@@ -285,7 +285,7 @@ static void r300EmitClearState(GLcontext * ctx)
 
        R300_STATECHANGE(r300, rr);
        reg_start(R300_RS_INST_0, 0);
-       e32(R300_RS_ROUTE_0_COLOR);
+       e32(R300_RS_INST_COL_CN_WRITE);
 
        R300_STATECHANGE(r300, fp);
        reg_start(R300_PFS_CNTL_0, 2);
index 3c52f16c30b6d9e51d3df888fe1a865b2b43f4e4..6fddc8fcf5bfd4eaf761fca3eb1ade615469f12d 100644 (file)
@@ -1175,7 +1175,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define R500_RS_INST_COL_CN_WRITE                      (1 << 16)\r
 #define R500_RS_INST_COL_CN_WRITE_FBUFFER              (2 << 16)\r
 #define R500_RS_INST_COL_CN_WRITE_BACKFACE             (3 << 16)\r
-#define R500_RS_INST_COL_COL_ADDR_SHIFT                        18\r
+#define R500_RS_INST_COL_ADDR_SHIFT                    18\r
 #define R500_RS_INST_TEX_ADJ                           (1 << 25)\r
 #define R500_RS_INST_W_CN                              (1 << 26)\r
 
@@ -1194,27 +1194,11 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #      define R300_RS_INST_TEX_CN_WRITE        (1 << 3)
 #      define R300_RS_INST_TEX_ADDR_SHIFT      6
 #      define R300_RS_INST_COL_ID(x)           ((x) << 11)
+#      define R300_RS_INST_COL_CN_WRITE        (1 << 14)
 #      define R300_RS_INST_COL_ADDR_SHIFT      17
 #      define R300_RS_INST_TEX_ADJ             (1 << 22)
 #      define R300_RS_COL_BIAS_UNUSED_SHIFT    23
 
-/* Special handling for color: When the fragment program uses color,
- * the ROUTE_0_COLOR bit is set and ROUTE_0_COLOR_DEST contains the
- * color register index.
- *
- * Apperently you may set the R300_RS_ROUTE_0_COLOR bit, but not provide any
- * R300_RS_ROUTE_0_COLOR_DEST value; this setup is used for clearing the state.
- * See r300_ioctl.c:r300EmitClearState. I'm not sure if this setup is strictly
- * correct or not. - Oliver.
- */
-#       define R300_RS_ROUTE_0_COLOR             (1 << 14)
-#       define R300_RS_ROUTE_0_COLOR_DEST_SHIFT  17
-#       define R300_RS_ROUTE_0_COLOR_DEST_MASK   (31 << 17) /* GUESS */
-/* As above, but for secondary color */
-#              define R300_RS_ROUTE_1_COLOR1            (1 << 14)
-#              define R300_RS_ROUTE_1_COLOR1_DEST_SHIFT 17
-#              define R300_RS_ROUTE_1_COLOR1_DEST_MASK  (31 << 17)
-#              define R300_RS_ROUTE_1_UNKNOWN11         (1 << 11)
 /* END: Rasterization / Interpolators - many guesses */
 
 /* Hierarchical Z Enable */
index 4f87772d92aff845036dcae440034e1c13c13b24..ff96a3b49bbebbaabe84d02329d2b527486fb3ae 100644 (file)
@@ -1565,7 +1565,7 @@ static void r300SetupRSUnit(GLcontext * ctx)
 
        if (InputsRead & FRAG_BIT_COL0) {
                if (R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_COL0, _TNL_ATTRIB_COLOR0)) {
-                       r300->hw.rr.cmd[R300_RR_INST_0] |= 0 | R300_RS_ROUTE_0_COLOR | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT);
+                       r300->hw.rr.cmd[R300_RR_INST_0] |= R300_RS_INST_COL_ID(0) | R300_RS_INST_COL_CN_WRITE | (fp_reg++ << R300_RS_INST_COL_ADDR_SHIFT);
                        InputsRead &= ~FRAG_BIT_COL0;
                        col_interp_nr++;
                } else {
@@ -1575,7 +1575,7 @@ static void r300SetupRSUnit(GLcontext * ctx)
 
        if (InputsRead & FRAG_BIT_COL1) {
                if (R300_OUTPUTS_WRITTEN_TEST(OutputsWritten, VERT_RESULT_COL1, _TNL_ATTRIB_COLOR1)) {
-                       r300->hw.rr.cmd[R300_RR_INST_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_INST_1] |= R300_RS_INST_COL_ID(1) | R300_RS_INST_COL_CN_WRITE | (fp_reg++ << R300_RS_INST_COL_ADDR_SHIFT);
                        InputsRead &= ~FRAG_BIT_COL1;
                        if (high_rr < 1)
                                high_rr = 1;
@@ -1587,7 +1587,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_INST_0] |= 0 | R300_RS_ROUTE_0_COLOR | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT);
+               r300->hw.rr.cmd[R300_RR_INST_0] |= R300_RS_INST_COL_ID(0) | R300_RS_INST_COL_CN_WRITE | (fp_reg++ << R300_RS_INST_COL_ADDR_SHIFT);
                col_interp_nr++;
        }