summaryrefslogtreecommitdiff
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorCorbin Simpson <MostAwesomeDude@gmail.com>2009-02-17 21:32:40 -0800
committerCorbin Simpson <MostAwesomeDude@gmail.com>2009-02-17 21:32:40 -0800
commit8e234d655dc3d8f8edefbf3bffdb726a331da2cd (patch)
treedc4d4815fc090316e04d4a93cd8206d5b04d652b /src/gallium/drivers
parent8ec853d4dfa344773b0d024d9cbe67d04cebe05c (diff)
r300-gallium: Add draw_arrays for swtcl_emit.
The more I look at this, the more bugs I see.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/r300/r300_swtcl_emit.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/gallium/drivers/r300/r300_swtcl_emit.c b/src/gallium/drivers/r300/r300_swtcl_emit.c
index c8e7afb81b..fb009247a5 100644
--- a/src/gallium/drivers/r300/r300_swtcl_emit.c
+++ b/src/gallium/drivers/r300/r300_swtcl_emit.c
@@ -174,6 +174,34 @@ static boolean r300_swtcl_render_set_primitive(struct vbuf_render* render,
return true;
}
+static void r300_swtcl_render_draw_arrays(struct vbuf_render* render,
+ unsigned start,
+ unsigned count)
+{
+ struct r300_swtcl_render* r300render = r300_swtcl_render(render);
+ struct r300_context* r300 = r300render->r300;
+ struct pipe_screen* screen = r300->context.screen;
+
+ CS_LOCALS(r300);
+
+ /* Make sure that all possible state is emitted. */
+ r300_update_derived_state(r300);
+ r300_emit_dirty_state(r300);
+
+ /* Take care of vertex formats and routes */
+ BEGIN_CS(3);
+ 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;
+
+ /* Draw stuff! */
+ BEGIN_CS(2);
+ OUT_CS(CP_PACKET3(R300_PACKET3_3D_DRAW_VBUF_2, 0));
+ OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (count << 16) |
+ r300render->hwprim | R300_VAP_VF_CNTL__INDEX_SIZE_32bit);
+}
+
static void r300_swtcl_render_draw(struct vbuf_render* render,
const ushort* indices,
uint count)
@@ -211,7 +239,7 @@ static void r300_swtcl_render_draw(struct vbuf_render* render,
/* Draw stuff! */
BEGIN_CS(10);
- OUT_CS(CP_PACKET3(R300_PACKET3_3D_DRAW_INDX, 0));
+ OUT_CS(CP_PACKET3(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);
@@ -243,7 +271,7 @@ static struct vbuf_render* r300_swtcl_render_create(struct r300_context* r300)
r300render->base.unmap_vertices = r300_swtcl_render_unmap_vertices;
r300render->base.set_primitive = r300_swtcl_render_set_primitive;
r300render->base.draw = r300_swtcl_render_draw;
- /* r300render->base.draw_arrays = r300_swtcl_render_draw_arrays; */
+ r300render->base.draw_arrays = r300_swtcl_render_draw_arrays;
r300render->base.release_vertices = r300_swtcl_render_release_vertices;
r300render->base.destroy = r300_swtcl_render_destroy;