[r300] Document POLY_MODE and add some TODOs that might have triggered some bugs
authorChristoph Brill <egore911@egore911.de>
Mon, 25 Feb 2008 21:55:13 +0000 (22:55 +0100)
committerChristoph Brill <egore911@egore911.de>
Mon, 25 Feb 2008 21:55:13 +0000 (22:55 +0100)
src/mesa/drivers/dri/r300/r300_cmdbuf.c
src/mesa/drivers/dri/r300/r300_reg.h
src/mesa/drivers/dri/r300/r300_state.c

index 0db4017b1f19ad90558dd03d848bc88a841365fe..ba8ecb0d0de5641de4b63468d84517aa943371f5 100644 (file)
@@ -344,7 +344,7 @@ void r300InitCmdBuf(r300ContextPtr r300)
        ALLOC_STATE(txe, always, R300_TXE_CMDSIZE, 0);
        r300->hw.txe.cmd[R300_TXE_CMD_0] = cmdpacket0(R300_TX_ENABLE, 1);
        ALLOC_STATE(ga_point_s0, always, 5, 0);
-       r300->hw.ga_point_s0.cmd[0] = cmdpacket0(R300_GA_POINT_S0, 4);
+       r300->hw.ga_point_s0.cmd[0] = cmdpacket0(GA_POINT_S0, 4);
        ALLOC_STATE(ga_triangle_stipple, always, 2, 0);
        r300->hw.ga_triangle_stipple.cmd[0] = cmdpacket0(R300_GA_TRIANGLE_STIPPLE, 1);
        ALLOC_STATE(ps, always, R300_PS_CMDSIZE, 0);
@@ -358,7 +358,7 @@ void r300InitCmdBuf(r300ContextPtr r300)
        ALLOC_STATE(shade, always, 5, 0);
        r300->hw.shade.cmd[0] = cmdpacket0(GA_ENHANCE, 4);
        ALLOC_STATE(polygon_mode, always, 4, 0);
-       r300->hw.polygon_mode.cmd[0] = cmdpacket0(R300_GA_POLY_MODE, 3);
+       r300->hw.polygon_mode.cmd[0] = cmdpacket0(GA_POLY_MODE, 3);
        ALLOC_STATE(fogp, always, 3, 0);
        r300->hw.fogp.cmd[0] = cmdpacket0(R300_RE_FOG_SCALE, 2);
        ALLOC_STATE(zbias_cntl, always, 2, 0);
index 5bc71b1b05328c41f937f7f9f7fc1a9b911b7892..fd551d9e1c9dd2cd0521997de9dffd4751980187 100644 (file)
@@ -627,10 +627,16 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #      define R500_TX_DIRECTION_VERITCAL        (1<<27)
 
 /* S Texture Coordinate of Vertex 0 for Point texture stuffing (LLC) */
-#define R300_GA_POINT_S0                    0x4200
+#define GA_POINT_S0                              0x4200
+
+/* T Texture Coordinate of Vertex 0 for Point texture stuffing (LLC) */
+#define GA_POINT_T0                              0x4204
 
 /* S Texture Coordinate of Vertex 2 for Point texture stuffing (URC) */
-#define R300_GA_POINT_S1                    0x4208
+#define GA_POINT_S1                              0x4208
+
+/* T Texture Coordinate of Vertex 2 for Point texture stuffing (URC) */
+#define GA_POINT_T1                              0x420c
 
 #define R300_GA_TRIANGLE_STIPPLE            0x4214
 
@@ -870,15 +876,21 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #define R300_GA_SOLID_RG                   0x427c
 #define R300_GA_SOLID_BA                   0x4280
-/* Dangerous */
-#define R300_GA_POLY_MODE                  0x4288
-#      define R300_PM_ENABLED                (1 << 0)
-#      define R300_PM_FRONT_POINT            (0 << 0)
-#      define R300_PM_BACK_POINT             (0 << 0)
-#      define R300_PM_FRONT_LINE             (1 << 4)
-#      define R300_PM_FRONT_FILL             (1 << 5)
-#      define R300_PM_BACK_LINE              (1 << 7)
-#      define R300_PM_BACK_FILL              (1 << 8)
+/* Polygon Mode
+ * Dangerous
+ */
+#define GA_POLY_MODE                             0x4288
+#      define GA_POLY_MODE_DISABLE           (0 << 0)
+#      define GA_POLY_MODE_DUAL              (1 << 0) /* send 2 sets of 3 polys with specified poly type */
+/* reserved */
+#      define GA_POLY_MODE_FRONT_PTYPE_POINT (0 << 4)
+#      define GA_POLY_MODE_FRONT_PTYPE_LINE  (1 << 4)
+#      define GA_POLY_MODE_FRONT_PTYPE_TRI   (2 << 4)
+/* reserved */
+#      define GA_POLY_MODE_BACK_PTYPE_POINT  (0 << 7)
+#      define GA_POLY_MODE_BACK_PTYPE_LINE   (1 << 7)
+#      define GA_POLY_MODE_BACK_PTYPE_TRI    (2 << 7)
+/* reserved */
 
 #define R300_GA_ROUND_MODE                 0x428c
 
index 5d4085544007d72d33fdb588bcfdabf2ead321c0..d3da15981b7dc793b5fad33b7ba57a7bac0791d8 100644 (file)
@@ -515,29 +515,29 @@ static void r300UpdatePolygonMode(GLcontext * ctx)
                        b = ctx->Polygon.FrontMode;
                }
 
-               hw_mode |= R300_PM_ENABLED;
+               hw_mode |= GA_POLY_MODE_DUAL;
 
                switch (f) {
                case GL_LINE:
-                       hw_mode |= R300_PM_FRONT_LINE;
+                       hw_mode |= GA_POLY_MODE_FRONT_PTYPE_LINE;
                        break;
-               case GL_POINT:  /* noop */
-                       hw_mode |= R300_PM_FRONT_POINT;
+               case GL_POINT:  /* TODO: noops, find out why */
+                       hw_mode |= GA_POLY_MODE_DISABLE;
                        break;
                case GL_FILL:
-                       hw_mode |= R300_PM_FRONT_FILL;
+                       hw_mode |= GA_POLY_MODE_FRONT_PTYPE_TRI;
                        break;
                }
 
                switch (b) {
                case GL_LINE:
-                       hw_mode |= R300_PM_BACK_LINE;
+                       hw_mode |= GA_POLY_MODE_BACK_PTYPE_LINE;
                        break;
-               case GL_POINT:  /* noop */
-                       hw_mode |= R300_PM_BACK_POINT;
+               case GL_POINT:  /* TODO: noops, find out why */
+                       hw_mode |= GA_POLY_MODE_DISABLE;
                        break;
                case GL_FILL:
-                       hw_mode |= R300_PM_BACK_FILL;
+                       hw_mode |= GA_POLY_MODE_BACK_PTYPE_TRI;
                        break;
                }
        }