svga: Avoid synchronization issues when doing SW TNL.
authorJosé Fonseca <jfonseca@vmware.com>
Thu, 21 Jan 2010 20:13:27 +0000 (12:13 -0800)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 21 Jan 2010 23:18:40 +0000 (15:18 -0800)
src/gallium/drivers/svga/svga_swtnl_backend.c

index cfbdcf2554cc8874718d0a5f061e80e11b9d2093..aafb3e26b0b9b7f134191f13fd774173294acece 100644 (file)
@@ -122,7 +122,9 @@ svga_vbuf_render_map_vertices( struct vbuf_render *render )
    char *ptr = (char*)pipe_buffer_map(screen,
                                       svga_render->vbuf,
                                       PIPE_BUFFER_USAGE_CPU_WRITE | 
-                                      PIPE_BUFFER_USAGE_FLUSH_EXPLICIT);
+                                      PIPE_BUFFER_USAGE_FLUSH_EXPLICIT |
+                                      PIPE_BUFFER_USAGE_DISCARD |
+                                      PIPE_BUFFER_USAGE_UNSYNCHRONIZED);
    return ptr + svga_render->vbuf_offset;
 }
 
@@ -264,8 +266,8 @@ svga_vbuf_render_draw( struct vbuf_render *render,
       svga_render->ibuf_offset = 0;
    }
 
-   pipe_buffer_write(screen, svga_render->ibuf,
-                     svga_render->ibuf_offset, 2 * nr_indices, indices);
+   pipe_buffer_write_nooverlap(screen, svga_render->ibuf,
+                                 svga_render->ibuf_offset, 2 * nr_indices, indices);
 
 
    /* off to hardware */