diff options
author | Zack Rusin <zackr@vmware.com> | 2010-06-15 08:05:51 -0400 |
---|---|---|
committer | Zack Rusin <zackr@vmware.com> | 2010-06-15 09:12:20 -0400 |
commit | a192b5eeafae80f9f9e7e7e442abc5b44d583d1a (patch) | |
tree | dac505a2bd9ee02cfc5d163c81a0587a7989625f /src/gallium/auxiliary/draw/draw_pt_so_emit.c | |
parent | 92e521a79982f19279f72c34772d33c9c28e2bed (diff) |
draw: finish the new pipeline setup
Keith came up with a new way of running the pipeline which involves passing
a few info structs around (for fetch, vertices and prims) and allows us
to correctly handle cases where we endup with multiple primitives generated
by the pipeline itself.
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pt_so_emit.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_pt_so_emit.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pt_so_emit.c b/src/gallium/auxiliary/draw/draw_pt_so_emit.c index 2bdfef114e..f5abb79f53 100644 --- a/src/gallium/auxiliary/draw/draw_pt_so_emit.c +++ b/src/gallium/auxiliary/draw/draw_pt_so_emit.c @@ -136,13 +136,14 @@ void draw_pt_so_emit( struct pt_so_emit *emit, const struct draw_vertex_info *vert_info, const struct draw_prim_info *prim_info ) { - const float (*vertex_data)[4] = vert_info->verts; + const float (*vertex_data)[4] = (const float (*)[4])vert_info->verts->data; unsigned vertex_count = vert_info->count; unsigned stride = vert_info->stride; struct draw_context *draw = emit->draw; struct translate *translate = emit->translate; struct vbuf_render *render = draw->render; void *so_buffer; + unsigned start, i; if (!emit->has_so) return; @@ -168,20 +169,20 @@ void draw_pt_so_emit( struct pt_so_emit *emit, translate->set_buffer(translate, 0, vertex_data, stride, ~0); - - for (start = i = 0; - i < prim_info->primitive_count; + + for (start = i = 0; i < prim_info->primitive_count; start += prim_info->primitive_lengths[i], i++) { unsigned count = prim_info->primitive_lengths[i]; - + if (prim_info->linear) { - translate->runXXX(translate, start, count, - draw->instance_id, so_buffer); + translate->run(translate, start, count, + draw->instance_id, so_buffer); } else { - translate->runYYY(translate, start, count, - draw->instance_id, so_buffer); + debug_assert(!"Stream output can't handle non-linear prims yet"); + translate->run(translate, start, count, + draw->instance_id, so_buffer); } } |