From 41966fdb3b71c0b70aeb095e0eb3c5626c144a3a Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Thu, 13 Jun 2013 17:57:47 -0400 Subject: draw: clear the draw buffers in draw Moves clearing of the draw so target buffers to the draw module. They had to be cleared in the drivers before which was quite messy. Signed-off-by: Zack Rusin Reviewed-by: Jose Fonseca Reviewed-by: Brian Paul --- src/gallium/drivers/llvmpipe/lp_context.h | 1 + src/gallium/drivers/llvmpipe/lp_draw_arrays.c | 4 ++-- src/gallium/drivers/llvmpipe/lp_state_so.c | 8 ++------ 3 files changed, 5 insertions(+), 8 deletions(-) (limited to 'src/gallium/drivers/llvmpipe') diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h index abfe852..0515968 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.h +++ b/src/gallium/drivers/llvmpipe/lp_context.h @@ -91,6 +91,7 @@ struct llvmpipe_context { struct draw_so_target *so_targets[PIPE_MAX_SO_BUFFERS]; int num_so_targets; + unsigned so_append_bitmask; struct pipe_query_data_so_statistics so_stats; unsigned num_primitives_generated; diff --git a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c index 4e23904..11b665a 100644 --- a/src/gallium/drivers/llvmpipe/lp_draw_arrays.c +++ b/src/gallium/drivers/llvmpipe/lp_draw_arrays.c @@ -104,7 +104,7 @@ llvmpipe_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) } } draw_set_mapped_so_targets(draw, lp->num_so_targets, - lp->so_targets); + lp->so_targets, lp->so_append_bitmask); llvmpipe_prepare_vertex_sampling(lp, lp->num_sampler_views[PIPE_SHADER_VERTEX], @@ -134,7 +134,7 @@ llvmpipe_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) if (mapped_indices) { draw_set_indexes(draw, NULL, 0, 0); } - draw_set_mapped_so_targets(draw, 0, NULL); + draw_set_mapped_so_targets(draw, 0, NULL, 0); if (lp->gs && !lp->gs->shader.tokens) { /* we have attached stream output to the vs for rendering, diff --git a/src/gallium/drivers/llvmpipe/lp_state_so.c b/src/gallium/drivers/llvmpipe/lp_state_so.c index fa58f79..c20ff26 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_so.c +++ b/src/gallium/drivers/llvmpipe/lp_state_so.c @@ -70,17 +70,13 @@ llvmpipe_set_so_targets(struct pipe_context *pipe, int i; for (i = 0; i < num_targets; i++) { pipe_so_target_reference((struct pipe_stream_output_target **)&llvmpipe->so_targets[i], targets[i]); - /* if we're not appending then lets reset the internal - data of our so target */ - if (!(append_bitmask & (1 << i)) && llvmpipe->so_targets[i]) { - llvmpipe->so_targets[i]->internal_offset = 0; - llvmpipe->so_targets[i]->emitted_vertices = 0; - } } for (; i < llvmpipe->num_so_targets; i++) { pipe_so_target_reference((struct pipe_stream_output_target **)&llvmpipe->so_targets[i], NULL); } + + llvmpipe->so_append_bitmask = append_bitmask; llvmpipe->num_so_targets = num_targets; } -- cgit v1.1