[g3dvl] create composite buffer with USAGE_STREAM
authorChristian König <deathsimple@vodafone.de>
Thu, 7 Apr 2011 20:59:48 +0000 (22:59 +0200)
committerChristian König <deathsimple@vodafone.de>
Thu, 7 Apr 2011 21:00:26 +0000 (23:00 +0200)
Also add PIPE_TRANSFER_DONTBLOCK to mapping options

src/gallium/auxiliary/vl/vl_compositor.c

index 46579a88ba7e5a8bb7ce541132dff37650a12d20..b601f32d4536ab58490cebc4bd08599ed1dcb203 100644 (file)
@@ -286,12 +286,11 @@ init_buffers(struct vl_compositor *c)
     */
    c->vertex_buf.stride = sizeof(struct vertex4f);
    c->vertex_buf.buffer_offset = 0;
-   /* XXX: Create with DYNAMIC or STREAM */
    c->vertex_buf.buffer = pipe_buffer_create
    (
       c->pipe->screen,
       PIPE_BIND_VERTEX_BUFFER,
-      PIPE_USAGE_STATIC,
+      PIPE_USAGE_STREAM,
       sizeof(struct vertex4f) * (VL_COMPOSITOR_MAX_LAYERS + 1) * 4
    );
 
@@ -382,7 +381,7 @@ gen_vertex_data(struct vl_compositor *c, struct pipe_video_rect *dst_rect, struc
    assert(dst_rect);
 
    vb = pipe_buffer_map(c->pipe, c->vertex_buf.buffer,
-                        PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD,
+                        PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD | PIPE_TRANSFER_DONTBLOCK,
                         &buf_transfer);
 
    if (!vb)