r300-gallium: Move a few registers.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Sat, 7 Mar 2009 09:53:42 +0000 (01:53 -0800)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Sat, 7 Mar 2009 21:28:02 +0000 (13:28 -0800)
These shouldn't be written if not on TCL HW.

src/gallium/drivers/r300/r300_state_invariant.c
src/gallium/drivers/r300/r300_surface.c

index c7c20c2de5bd9d0ab26673d7f234bd3c5968389d..5646d228357db1bbf81266abeacfc8ce9af49eeb 100644 (file)
@@ -34,9 +34,8 @@ void r300_emit_invariant_state(struct r300_context* r300)
     struct r300_capabilities* caps = r300_screen(r300->context.screen)->caps;
     CS_LOCALS(r300);
 
-    BEGIN_CS(26);
-    /* Amount of time to wait for vertex fetches in PVS */
-    OUT_CS_REG(VAP_PVS_VTX_TIMEOUT_REG, 0xffff);
+    BEGIN_CS(24 + (caps->has_tcl ? 2: 0));
+
     /* Various GB enables */
     OUT_CS_REG(R300_GB_ENABLE, R300_GB_POINT_STUFF_ENABLE |
         R300_GB_LINE_STUFF_ENABLE | R300_GB_TRIANGLE_STUFF_ENABLE);
@@ -69,5 +68,12 @@ void r300_emit_invariant_state(struct r300_context* r300)
     OUT_CS_REG(R300_FG_FOG_COLOR_G, 0x00000000);
     OUT_CS_REG(R300_FG_FOG_COLOR_B, 0x00000000);
     OUT_CS_REG(R300_FG_DEPTH_SRC, 0x00000000);
+
+    /* TCL-only stuff */
+    if (caps->has_tcl) {
+        /* Amount of time to wait for vertex fetches in PVS */
+        OUT_CS_REG(VAP_PVS_VTX_TIMEOUT_REG, 0xffff);
+    }
+
     END_CS;
 }
index 2040967253f830a358c27536e7178631fe8ae91c..e7ba06fa3c637e86f28ad39ca84a8494523bfca4 100644 (file)
@@ -72,7 +72,7 @@ static void r300_surface_fill(struct pipe_context* pipe,
         r300_emit_rs_block_state(r300, &r300_rs_block_clear_state);
     }
 
-    BEGIN_CS(106 + (caps->has_tcl ? 2 : 0));
+    BEGIN_CS(99 + (caps->has_tcl ? 9 : 0));
     /* Flush PVS. */
     OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0);
 
@@ -86,6 +86,13 @@ static void r300_surface_fill(struct pipe_context* pipe,
     /* XXX endian */
     if (caps->has_tcl) {
         OUT_CS_REG(R300_VAP_CNTL_STATUS, R300_VC_NO_SWAP);
+        OUT_CS_REG(R300_VAP_CLIP_CNTL, R300_CLIP_DISABLE |
+            R300_PS_UCP_MODE_CLIP_AS_TRIFAN);
+        OUT_CS_REG_SEQ(R300_VAP_GB_VERT_CLIP_ADJ, 4);
+        OUT_CS_32F(1.0);
+        OUT_CS_32F(1.0);
+        OUT_CS_32F(1.0);
+        OUT_CS_32F(1.0);
     } else {
         OUT_CS_REG(R300_VAP_CNTL_STATUS, R300_VC_NO_SWAP |
                 R300_VAP_TCL_BYPASS);
@@ -93,12 +100,6 @@ static void r300_surface_fill(struct pipe_context* pipe,
     OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0, 0x0);
     /* XXX magic number not in r300_reg */
     OUT_CS_REG(R300_VAP_PSC_SGN_NORM_CNTL, 0xAAAAAAAA);
-    OUT_CS_REG(R300_VAP_CLIP_CNTL, 0x0);
-    OUT_CS_REG_SEQ(R300_VAP_GB_VERT_CLIP_ADJ, 4);
-    OUT_CS_32F(1.0);
-    OUT_CS_32F(1.0);
-    OUT_CS_32F(1.0);
-    OUT_CS_32F(1.0);
     /* XXX point tex stuffing */
     OUT_CS_REG_SEQ(R300_GA_POINT_S0, 1);
     OUT_CS_32F(0.0);
@@ -164,11 +165,6 @@ static void r300_surface_fill(struct pipe_context* pipe,
     OUT_CS_32F(1.0);
     OUT_CS_32F(0.0);
 
-    if (caps->has_tcl) {
-        OUT_CS_REG(R300_VAP_CLIP_CNTL, R300_CLIP_DISABLE |
-            R300_PS_UCP_MODE_CLIP_AS_TRIFAN);
-    }
-
     /* XXX */
     OUT_CS_REG(R300_SC_CLIP_RULE, 0xaaaa);
     END_CS;