summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2013-06-17 21:06:11 -0400
committerZack Rusin <[email protected]>2013-06-17 21:43:10 -0400
commit9542131b273d01d2c3403e6791172347cb792e34 (patch)
tree8dad771a75c40ae6c051a81c4e31636e54e1cc85 /src/gallium/drivers/llvmpipe
parent8975dc798d6b7790de7a788c8263b636cfd02184 (diff)
Revert "draw: clear the draw buffers in draw"
This reverts commit 41966fdb3b71c0b70aeb095e0eb3c5626c144a3a. While it's a lot cleaner it causes regressions because the draw interface is always called from the draw functions of the drivers (because the buffers need to be mapped) which means that the stream output buffers endup being cleared on every draw rather than on setting. Signed-off-by: Zack Rusin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_context.h1
-rw-r--r--src/gallium/drivers/llvmpipe/lp_draw_arrays.c4
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_so.c8
3 files changed, 8 insertions, 5 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h
index 27e8b0134d0..ab520019f82 100644
--- a/src/gallium/drivers/llvmpipe/lp_context.h
+++ b/src/gallium/drivers/llvmpipe/lp_context.h
@@ -91,7 +91,6 @@ 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 11b665af8ef..4e239043ec4 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_append_bitmask);
+ lp->so_targets);
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, 0);
+ draw_set_mapped_so_targets(draw, 0, NULL);
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 c20ff26639d..fa58f79c9c1 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_so.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_so.c
@@ -70,13 +70,17 @@ 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;
}