diff options
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_draw_arrays.c')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_draw_arrays.c | 62 |
1 files changed, 10 insertions, 52 deletions
diff --git a/src/gallium/drivers/softpipe/sp_draw_arrays.c b/src/gallium/drivers/softpipe/sp_draw_arrays.c index 69b5b96b4fd..27004071f02 100644 --- a/src/gallium/drivers/softpipe/sp_draw_arrays.c +++ b/src/gallium/drivers/softpipe/sp_draw_arrays.c @@ -43,58 +43,6 @@ #include "draw/draw_context.h" - - - - -void -softpipe_draw_stream_output(struct pipe_context *pipe, unsigned mode) -{ - struct softpipe_context *sp = softpipe_context(pipe); - struct draw_context *draw = sp->draw; - const unsigned start = 0; - const unsigned count = sp->so_target.so_count[0]; - void *buf = sp->so_target.buffer[0]->data; - int offset = sp->so_target.offset[0]; - - if (!softpipe_check_render_cond(sp) || - sp->so_target.num_buffers != 1) - return; - - sp->reduced_api_prim = u_reduced_prim(mode); - - if (sp->dirty) { - softpipe_update_derived(sp, sp->reduced_api_prim); - } - - softpipe_map_transfers(sp); - - /* Map so buffers */ - if (offset < 0) /* we were appending so start from beginning */ - offset = 0; - buf = (void*)((int32_t*)buf + offset); - draw_set_mapped_vertex_buffer(draw, 0, buf); - - draw_set_mapped_index_buffer(draw, NULL); - - /* draw! */ - draw_arrays(draw, mode, start, count); - - /* unmap vertex/index buffers - will cause draw module to flush */ - draw_set_mapped_vertex_buffer(draw, 0, NULL); - - /* - * TODO: Flush only when a user vertex/index buffer is present - * (or even better, modify draw module to do this - * internally when this condition is seen?) - */ - draw_flush(draw); - - /* Note: leave drawing surfaces mapped */ - sp->dirty_render_cache = TRUE; -} - - /** * This function handles drawing indexed and non-indexed prims, * instanced and non-instanced drawing, with or without min/max element @@ -139,6 +87,14 @@ softpipe_draw_vbo(struct pipe_context *pipe, draw_set_mapped_index_buffer(draw, mapped_indices); + for (i = 0; i < sp->num_so_targets; i++) { + void *buf = softpipe_resource(sp->so_targets[i]->target.buffer)->data; + sp->so_targets[i]->mapping = buf; + } + + draw_set_mapped_so_targets(draw, sp->num_so_targets, + sp->so_targets); + /* draw! */ draw_vbo(draw, info); @@ -150,6 +106,8 @@ softpipe_draw_vbo(struct pipe_context *pipe, draw_set_mapped_index_buffer(draw, NULL); } + draw_set_mapped_so_targets(draw, 0, NULL); + /* * TODO: Flush only when a user vertex/index buffer is present * (or even better, modify draw module to do this |