llvmpipe: reset so buffers when not appending
authorZack Rusin <zackr@vmware.com>
Sat, 30 Mar 2013 07:21:03 +0000 (00:21 -0700)
committerZack Rusin <zackr@vmware.com>
Wed, 3 Apr 2013 17:16:25 +0000 (10:16 -0700)
We need to reset the internal state of the so buffers or we'll
keep appending even though we're not supposed to.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/gallium/drivers/llvmpipe/lp_state_so.c

index 58bab3964350989158f0f2d7873aa2f99e229fa2..fa58f79c9c15326578c12b29b95c675bb7297d8d 100644 (file)
@@ -70,6 +70,12 @@ 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++) {