summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_render.c
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2009-04-08 14:54:17 -0700
committerCorbin Simpson <[email protected]>2009-04-08 15:31:04 -0700
commit8648c2685870174cf620ef15de70ef030a8d5a20 (patch)
tree1b514371ca248c6d4c83e09beeb73f27467d8bfe /src/gallium/drivers/r300/r300_render.c
parentb3639d43f2085c893bb6136c8febe5bc7944869e (diff)
r300-gallium: Properly emit indexbufs.
This fixes hardlocks with anything using elts.
Diffstat (limited to 'src/gallium/drivers/r300/r300_render.c')
-rw-r--r--src/gallium/drivers/r300/r300_render.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
index 57bbc7a9944..b7ee8fb8a94 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -241,7 +241,7 @@ static void r300_render_draw(struct vbuf_render* render,
/* Send our indices into an index buffer. */
index_buffer = pipe_buffer_create(screen, 64, PIPE_BUFFER_USAGE_VERTEX,
- count);
+ count * 2);
if (!index_buffer) {
return;
}
@@ -253,14 +253,13 @@ static void r300_render_draw(struct vbuf_render* render,
debug_printf("r300: Doing indexbuf render, count %d\n", count);
- BEGIN_CS(5);
+ BEGIN_CS(6);
OUT_CS_PKT3(R300_PACKET3_3D_DRAW_INDX_2, 0);
OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (count << 16) |
- r300render->hwprim | R300_VAP_VF_CNTL__INDEX_SIZE_32bit);
-
+ r300render->hwprim);
OUT_CS_PKT3(R300_PACKET3_INDX_BUFFER, 2);
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);
+ OUT_CS_INDEX_RELOC(index_buffer, 0, count, RADEON_GEM_DOMAIN_GTT, 0, 0);
END_CS;
}