r300-gallium: Use VAP_CLIP_CNTL.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Fri, 5 Jun 2009 20:46:59 +0000 (13:46 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Fri, 5 Jun 2009 20:46:59 +0000 (13:46 -0700)
Makes tri-userclip work with HW TCL.

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

index 4c7370eee719e15369a8a091877ccabfad06d098..d81abe4d0b2964dbf9623f2d64403b63ad4e02ae 100644 (file)
@@ -63,7 +63,7 @@ void r300_emit_clip_state(struct r300_context* r300,
     struct r300_screen* r300screen = r300_screen(r300->context.screen);
     CS_LOCALS(r300);
 
-    BEGIN_CS(3 + (6 * 4));
+    BEGIN_CS(5 + (6 * 4));
     OUT_CS_REG(R300_VAP_PVS_VECTOR_INDX_REG,
             (r300screen->caps->is_r500 ?
              R500_PVS_UCP_START : R300_PVS_UCP_START));
@@ -74,6 +74,9 @@ void r300_emit_clip_state(struct r300_context* r300,
         OUT_CS_32F(clip->ucp[i][2]);
         OUT_CS_32F(clip->ucp[i][3]);
     }
+
+    OUT_CS_REG(R300_VAP_CLIP_CNTL, ((1 << clip->nr) - 1) |
+            R300_PS_UCP_MODE_CLIP_AS_TRIFAN);
     END_CS;
 }
 
index 9dde662802b421ec9ced3e6a1b73b0ae6788e8fb..60eff08f2e9542a1be19d8a673158f20d3c17795 100644 (file)
@@ -69,7 +69,7 @@ void r300_emit_invariant_state(struct r300_context* r300)
     END_CS;
 
     /* XXX unsorted stuff from surface_fill */
-    BEGIN_CS(77 + (caps->has_tcl ? 7 : 0));
+    BEGIN_CS(75 + (caps->has_tcl ? 7 : 0));
     /* Flush PVS. */
     OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0);
 
@@ -80,8 +80,6 @@ void r300_emit_invariant_state(struct r300_context* r300)
     /* 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);