summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-11-23 14:09:21 +0100
committerMarek Olšák <maraeo@gmail.com>2010-11-25 20:25:53 +0100
commit2c1de07ddf9f4de6813f0ed46fc859b2f61db7b2 (patch)
tree4d667650d248645d51b893a1f1191c4e0db9fbcb /src/gallium/auxiliary
parentc14a261eb96b52052233e7590aa2c28f6f21b8ea (diff)
u_blitter: use PIPE_TRANSFER_DISCARD to prevent cpu/gpu stall
But the driver must be smart here and follow PIPE_TRANSFER_DISCARD, as it should.
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/util/u_blitter.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c
index a163f93cb8..31fc75aa11 100644
--- a/src/gallium/auxiliary/util/u_blitter.c
+++ b/src/gallium/auxiliary/util/u_blitter.c
@@ -522,10 +522,13 @@ static void blitter_set_dst_dimensions(struct blitter_context_priv *ctx,
static void blitter_draw_quad(struct blitter_context_priv *ctx)
{
struct pipe_context *pipe = ctx->base.pipe;
+ struct pipe_box box;
/* write vertices and draw them */
- pipe_buffer_write(pipe, ctx->vbuf,
- 0, sizeof(ctx->vertices), ctx->vertices);
+ u_box_1d(0, sizeof(ctx->vertices), &box);
+ pipe->transfer_inline_write(pipe, ctx->vbuf, u_subresource(0,0),
+ PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD,
+ &box, ctx->vertices, sizeof(ctx->vertices), 0);
util_draw_vertex_buffer(pipe, ctx->vbuf, 0, PIPE_PRIM_TRIANGLE_FAN,
4, /* verts */