r500: default rsunit swizzle like fglrx
authorDave Airlie <airlied@redhat.com>
Thu, 15 May 2008 10:38:41 +0000 (20:38 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 15 May 2008 10:38:41 +0000 (20:38 +1000)
src/mesa/drivers/dri/r300/r300_cmdbuf.c
src/mesa/drivers/dri/r300/r300_state.c

index 8596b466409fa5898b07cd0480298b8a1133fba8..7ddb1a946e8de18db4029329816519a635e44a1d 100644 (file)
@@ -297,6 +297,7 @@ void r300InitCmdBuf(r300ContextPtr r300)
        int size, mtu;
        int has_tcl = 1;
        int is_r500 = 0;
+       int i;
 
        if (!(r300->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL))
                has_tcl = 0;
@@ -396,6 +397,13 @@ void r300InitCmdBuf(r300ContextPtr r300)
        if (is_r500) {
                ALLOC_STATE(ri, always, R500_RI_CMDSIZE, 0);
                r300->hw.ri.cmd[R300_RI_CMD_0] = cmdpacket0(R500_RS_IP_0, 16);
+               for (i = 0; i < 8; i++) {
+                       r300->hw.ri.cmd[R300_RI_CMD_0 + i +1] = 
+                         (R500_RS_IP_PTR_K0 << R500_RS_IP_TEX_PTR_S_SHIFT) |
+                          (R500_RS_IP_PTR_K0 << R500_RS_IP_TEX_PTR_T_SHIFT) |
+                          (R500_RS_IP_PTR_K0 << R500_RS_IP_TEX_PTR_R_SHIFT) |
+                          (R500_RS_IP_PTR_K1 << R500_RS_IP_TEX_PTR_Q_SHIFT);
+               }
                ALLOC_STATE(rr, variable, R300_RR_CMDSIZE, 0);
                r300->hw.rr.cmd[R300_RR_CMD_0] = cmdpacket0(R500_RS_INST_0, 1);
        } else {
index 006c2808c586117eaff758deb66b160779d52ecc..175c3859156f84a6dcd73106154a24e23027af3e 100644 (file)
@@ -1716,7 +1716,6 @@ static void r500SetupRSUnit(GLcontext * ctx)
                  else
                    count = VB->AttribPtr[_TNL_ATTRIB_TEX(i)]->size;
                  
-                 swiz = 0;
                  /* always have a least 2 tex coords */
                  swiz |= in_texcoords++ << R500_RS_IP_TEX_PTR_S_SHIFT;
                  swiz |= in_texcoords++ << R500_RS_IP_TEX_PTR_T_SHIFT;
@@ -1731,8 +1730,12 @@ static void r500SetupRSUnit(GLcontext * ctx)
                  else
                    swiz |= R500_RS_IP_PTR_K1 << R500_RS_IP_TEX_PTR_Q_SHIFT;
                  
-                 
-               }
+               } else
+                  swiz = (R500_RS_IP_PTR_K0 << R500_RS_IP_TEX_PTR_S_SHIFT) |
+                         (R500_RS_IP_PTR_K0 << R500_RS_IP_TEX_PTR_T_SHIFT) |
+                         (R500_RS_IP_PTR_K0 << R500_RS_IP_TEX_PTR_R_SHIFT) |
+                         (R500_RS_IP_PTR_K1 << R500_RS_IP_TEX_PTR_Q_SHIFT);
+
                r300->hw.ri.cmd[R300_RI_INTERP_0 + i] = interp_col[i] | swiz;
 
                r300->hw.rr.cmd[R300_RR_INST_0 + fp_reg] = 0;