summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2009-03-05 10:46:52 -0800
committerCorbin Simpson <[email protected]>2009-03-05 12:41:53 -0800
commit626ac953354156f2545d90960f6712a2248ba795 (patch)
tree4bfbcf2cc68154d4498d637fef9d1cc089e496cc
parenta3b168df48302b5bbd2323685623adee240d03a4 (diff)
r300-gallium: Fix up vertex count.
-rw-r--r--src/gallium/drivers/r300/r300_swtcl_emit.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/gallium/drivers/r300/r300_swtcl_emit.c b/src/gallium/drivers/r300/r300_swtcl_emit.c
index 01235674ac8..7f0fc029713 100644
--- a/src/gallium/drivers/r300/r300_swtcl_emit.c
+++ b/src/gallium/drivers/r300/r300_swtcl_emit.c
@@ -174,7 +174,7 @@ static boolean r300_swtcl_render_set_primitive(struct vbuf_render* render,
return TRUE;
}
-static void prepare_render(struct r300_swtcl_render* render)
+static void prepare_render(struct r300_swtcl_render* render, unsigned count)
{
struct r300_context* r300 = render->r300;
int i;
@@ -186,7 +186,7 @@ static void prepare_render(struct r300_swtcl_render* render)
debug_printf("r300: Preparing vertex buffer %p for render, "
"vertex size %d, vertex count %d\n", render->vbo,
- r300->vertex_info.vinfo.size, render->vbo_size);
+ r300->vertex_info.vinfo.size, count);
/* Set the pointer to our vertex buffer. The emitted values are this:
* PACKET3 [3D_LOAD_VBPNTR]
* COUNT [1]
@@ -194,7 +194,7 @@ static void prepare_render(struct r300_swtcl_render* render)
* OFFSET [0]
* VBPNTR [relocated BO]
*/
- BEGIN_CS(5);
+ BEGIN_CS(7);
OUT_CS(CP_PACKET3(R300_PACKET3_3D_LOAD_VBPNTR, 3));
OUT_CS(1);
OUT_CS(r300->vertex_info.vinfo.size |
@@ -214,7 +214,11 @@ static void r300_swtcl_render_draw_arrays(struct vbuf_render* render,
CS_LOCALS(r300);
- prepare_render(r300render);
+ count /= 4;
+
+ r300render->vbo_offset = start;
+
+ prepare_render(r300render, count);
debug_printf("r300: Doing vbuf render, count %d\n", count);
@@ -237,7 +241,9 @@ static void r300_swtcl_render_draw(struct vbuf_render* render,
CS_LOCALS(r300);
- prepare_render(r300render);
+ count /= 4;
+
+ prepare_render(r300render, count);
/* Send our indices into an index buffer. */
index_buffer = pipe_buffer_create(screen, 64, PIPE_BUFFER_USAGE_VERTEX,
@@ -252,7 +258,7 @@ static void r300_swtcl_render_draw(struct vbuf_render* render,
pipe_buffer_unmap(screen, index_buffer);
debug_printf("r300: Doing indexbuf render, count %d\n", count);
-
+#if 0
BEGIN_CS(5);
OUT_CS(CP_PACKET3(R300_PACKET3_3D_DRAW_INDX_2, 0));
OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (count << 16) |
@@ -262,6 +268,7 @@ static void r300_swtcl_render_draw(struct vbuf_render* render,
OUT_CS(R300_INDX_BUFFER_ONE_REG_WR | (R300_VAP_PORT_IDX0 >> 2));
OUT_CS_RELOC(index_buffer, 0, RADEON_GEM_DOMAIN_GTT, 0, 0);
END_CS;
+#endif
}
static void r300_swtcl_render_destroy(struct vbuf_render* render)