r300-gallium: Fix BEGIN_CS and END_CS counting and mismatch.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 16 Feb 2009 11:55:16 +0000 (03:55 -0800)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 16 Feb 2009 12:12:42 +0000 (04:12 -0800)
src/gallium/drivers/r300/r300_emit.c
src/gallium/drivers/r300/r300_surface.c
src/gallium/drivers/r300/r300_swtcl_emit.c

index 32c9681d2b7a77e5f2263c30961e92709ced383e..a2819294a4f32496e9f356e9b4e7af55749ed8cb 100644 (file)
@@ -194,7 +194,7 @@ void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs)
     struct r300_screen* r300screen =
         (struct r300_screen*)r300->context.screen;
     CS_LOCALS(r300);
-    BEGIN_CS(14);
+    BEGIN_CS(13);
     OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status);
     OUT_CS_REG_SEQ(R300_SU_POLY_OFFSET_FRONT_SCALE, 6);
     OUT_CS(rs->depth_scale_front);
@@ -216,6 +216,7 @@ void r300_emit_scissor_state(struct r300_context* r300,
     OUT_CS_REG_SEQ(R300_SC_SCISSORS_TL, 2);
     OUT_CS(scissor->scissor_top_left);
     OUT_CS(scissor->scissor_bottom_right);
+    END_CS;
 }
 
 /* Emit all dirty state. */
index 0a4710151a038d82dc8e8b386bf06d5970b8947d..b2c4f4251d99805a8ff267e71b3f9faa3d8db7be 100644 (file)
@@ -54,7 +54,7 @@ static void r300_surface_fill(struct pipe_context* pipe,
         return;
     }
 
-    BEGIN_CS(161 + (caps->is_r500 ? 22 : 14) + (caps->has_tcl ? 4 : 2));
+    BEGIN_CS(163 + (caps->is_r500 ? 22 : 14) + (caps->has_tcl ? 4 : 2));
     /* Flush PVS. */
     OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0);
 
index ca078d63e0e7b8d2ccb71799887f55f57ef11611..76ef48962b9fd7461536f101de7577df7da3598e 100644 (file)
@@ -48,8 +48,6 @@ static INLINE void r300_emit_vertex(struct r300_context* r300,
     CS_LOCALS(r300);
     uint i, j;
 
-    BEGIN_CS(vinfo->size);
-
     for (i = 0; i < vinfo->num_attribs; i++) {
         j = vinfo->attrib[i].src_index;
         switch (vinfo->attrib[i].emit) {
@@ -77,8 +75,6 @@ static INLINE void r300_emit_vertex(struct r300_context* r300,
                 break;
         }
     }
-
-    END_CS;
 }
 
 static INLINE void r300_emit_prim(struct draw_stage* draw,
@@ -96,6 +92,7 @@ static INLINE void r300_emit_prim(struct draw_stage* draw,
     OUT_CS_REG_SEQ(R300_VAP_OUTPUT_VTX_FMT_0, 2);
     OUT_CS(r300->vertex_info.hwfmt[0]);
     OUT_CS(r300->vertex_info.hwfmt[1]);
+    END_CS;
 
     BEGIN_CS(2 + (count * r300->vertex_info.size) + 2);
     OUT_CS(CP_PACKET3(R200_3D_DRAW_IMMD_2, count));