r300: move to using RS_INST names
authorDave Airlie <airlied@redhat.com>
Fri, 28 Mar 2008 02:06:28 +0000 (13:06 +1100)
committerDave Airlie <airlied@redhat.com>
Fri, 28 Mar 2008 02:06:28 +0000 (13:06 +1100)
src/mesa/drivers/dri/r300/r300_cmdbuf.c
src/mesa/drivers/dri/r300/r300_context.h
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 1abc92ec492f4b670ef584e2f016c835fe0aacc8..3497738eacf4434cd7ea1bbbb356dc77a4e29545 100644 (file)
@@ -377,7 +377,7 @@ void r300InitCmdBuf(r300ContextPtr r300)
        ALLOC_STATE(ri, always, R300_RI_CMDSIZE, 0);
        r300->hw.ri.cmd[R300_RI_CMD_0] = cmdpacket0(R300_RS_IP_0, 8);
        ALLOC_STATE(rr, variable, R300_RR_CMDSIZE, 0);
-       r300->hw.rr.cmd[R300_RR_CMD_0] = cmdpacket0(R300_RS_ROUTE_0, 1);
+       r300->hw.rr.cmd[R300_RR_CMD_0] = cmdpacket0(R300_RS_INST_0, 1);
        ALLOC_STATE(sc_hyperz, always, 3, 0);
        r300->hw.sc_hyperz.cmd[0] = cmdpacket0(R300_SC_HYPERZ, 2);
        ALLOC_STATE(sc_screendoor, always, 2, 0);
index 993aa5199055b7d4c6f17d8006e16588ec6a98d4..780d9aa5d282211963e46b9e28e6cb37e1323a2c 100644 (file)
@@ -331,14 +331,14 @@ struct r300_state_atom {
 #define R300_RI_CMDSIZE                9
 
 #define R300_RR_CMD_0          0       /* rr is variable size (at least 1) */
-#define R300_RR_ROUTE_0                1
-#define R300_RR_ROUTE_1                2
-#define R300_RR_ROUTE_2                3
-#define R300_RR_ROUTE_3                4
-#define R300_RR_ROUTE_4                5
-#define R300_RR_ROUTE_5                6
-#define R300_RR_ROUTE_6                7
-#define R300_RR_ROUTE_7                8
+#define R300_RR_INST_0         1
+#define R300_RR_INST_1         2
+#define R300_RR_INST_2         3
+#define R300_RR_INST_3         4
+#define R300_RR_INST_4         5
+#define R300_RR_INST_5         6
+#define R300_RR_INST_6         7
+#define R300_RR_INST_7         8
 #define R300_RR_CMDSIZE                9
 
 #define R300_FP_CMD_0          0
index 02c67e8ef9c63238337c0c36ac00057c8bd7f5f7..a678922ae2102ce06664c6e8fc65ce91456637b4 100644 (file)
@@ -284,7 +284,7 @@ static void r300EmitClearState(GLcontext * ctx)
        e32(0x0);
 
        R300_STATECHANGE(r300, rr);
-       reg_start(R300_RS_ROUTE_0, 0);
+       reg_start(R300_RS_INST_0, 0);
        e32(R300_RS_ROUTE_0_COLOR);
 
        R300_STATECHANGE(r300, fp);
index ac6b0e63b59702d3a3adbba03fca1aab135e2596..3c52f16c30b6d9e51d3df888fe1a865b2b43f4e4 100644 (file)
@@ -1182,25 +1182,21 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 /* These DWORDs control how vertex data is routed into fragment program
  * registers, after interpolators.
  */
-#define R300_RS_ROUTE_0                     0x4330
-#define R300_RS_ROUTE_1                     0x4334
-#define R300_RS_ROUTE_2                     0x4338
-#define R300_RS_ROUTE_3                     0x433C /* GUESS */
-#define R300_RS_ROUTE_4                     0x4340 /* GUESS */
-#define R300_RS_ROUTE_5                     0x4344 /* GUESS */
-#define R300_RS_ROUTE_6                     0x4348 /* GUESS */
-#define R300_RS_ROUTE_7                     0x434C /* GUESS */
-#       define R300_RS_ROUTE_SOURCE_INTERP_0     0
-#       define R300_RS_ROUTE_SOURCE_INTERP_1     1
-#       define R300_RS_ROUTE_SOURCE_INTERP_2     2
-#       define R300_RS_ROUTE_SOURCE_INTERP_3     3
-#       define R300_RS_ROUTE_SOURCE_INTERP_4     4
-#       define R300_RS_ROUTE_SOURCE_INTERP_5     5 /* GUESS */
-#       define R300_RS_ROUTE_SOURCE_INTERP_6     6 /* GUESS */
-#       define R300_RS_ROUTE_SOURCE_INTERP_7     7 /* GUESS */
-#       define R300_RS_ROUTE_ENABLE              (1 << 3) /* GUESS */
-#       define R300_RS_ROUTE_DEST_SHIFT          6
-#       define R300_RS_ROUTE_DEST_MASK           (31 << 6) /* GUESS */
+#define R300_RS_INST_0                     0x4330
+#define R300_RS_INST_1                     0x4334
+#define R300_RS_INST_2                     0x4338
+#define R300_RS_INST_3                     0x433C /* GUESS */
+#define R300_RS_INST_4                     0x4340 /* GUESS */
+#define R300_RS_INST_5                     0x4344 /* GUESS */
+#define R300_RS_INST_6                     0x4348 /* GUESS */
+#define R300_RS_INST_7                     0x434C /* GUESS */
+#      define R300_RS_INST_TEX_ID(x)           ((x) << 0)
+#      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_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
index ec9bf25bab325cc6a9c6353b2bb798fa039be250..4f87772d92aff845036dcae440034e1c13c13b24 100644 (file)
@@ -1522,7 +1522,7 @@ static void r300SetupRSUnit(GLcontext * ctx)
 
        fp_reg = in_texcoords = col_interp_nr = high_rr = 0;
 
-       r300->hw.rr.cmd[R300_RR_ROUTE_1] = 0;
+       r300->hw.rr.cmd[R300_RR_INST_1] = 0;
 
        if (InputsRead & FRAG_BIT_WPOS) {
                for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
@@ -1542,11 +1542,11 @@ static void r300SetupRSUnit(GLcontext * ctx)
                r300->hw.ri.cmd[R300_RI_INTERP_0 + i] = 0 | R300_RS_SEL_T(1) | R300_RS_SEL_R(2) | R300_RS_SEL_Q(3) | (in_texcoords << R300_RS_INTERP_SRC_SHIFT)
                    | interp_magic[i];
 
-               r300->hw.rr.cmd[R300_RR_ROUTE_0 + fp_reg] = 0;
+               r300->hw.rr.cmd[R300_RR_INST_0 + fp_reg] = 0;
                if (InputsRead & (FRAG_BIT_TEX0 << i)) {
                        //assert(r300->state.texture.tc_count != 0);
-                       r300->hw.rr.cmd[R300_RR_ROUTE_0 + fp_reg] |= R300_RS_ROUTE_ENABLE | i   /* source INTERP */
-                           | (fp_reg << R300_RS_ROUTE_DEST_SHIFT);
+                       r300->hw.rr.cmd[R300_RR_INST_0 + fp_reg] |= R300_RS_INST_TEX_CN_WRITE | i       /* source INTERP */
+                           | (fp_reg << R300_RS_INST_TEX_ADDR_SHIFT);
                        high_rr = fp_reg;
 
                        /* Passing invalid data here can lock the GPU. */
@@ -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_ROUTE_0] |= 0 | R300_RS_ROUTE_0_COLOR | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT);
+                       r300->hw.rr.cmd[R300_RR_INST_0] |= 0 | R300_RS_ROUTE_0_COLOR | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_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_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_INST_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;
@@ -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_ROUTE_0] |= 0 | R300_RS_ROUTE_0_COLOR | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT);
+               r300->hw.rr.cmd[R300_RR_INST_0] |= 0 | R300_RS_ROUTE_0_COLOR | (fp_reg++ << R300_RS_ROUTE_0_COLOR_DEST_SHIFT);
                col_interp_nr++;
        }
 
@@ -1596,7 +1596,7 @@ static void r300SetupRSUnit(GLcontext * ctx)
          | R300_HIRES_EN;
 
        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_INST_0, high_rr + 1);
        r300->hw.rc.cmd[2] = 0xC0 | high_rr;
 
        if (InputsRead)