summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/util/u_blit.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-02-24 11:30:25 +0000
committerJosé Fonseca <jfonseca@vmware.com>2009-02-24 11:30:25 +0000
commit693fac8ae2e5812265222b1335695bd33b90bd8a (patch)
treedf1bf997bcec57a8b9db1451c8fb40c488221ef0 /src/gallium/auxiliary/util/u_blit.c
parentc5dd8634c8d3487a171cd129c2b7ac6e205e72a7 (diff)
gallium: Add pipe_buffer_write/read inlines.
Saves code, and will simplify future interface changes.
Diffstat (limited to 'src/gallium/auxiliary/util/u_blit.c')
-rw-r--r--src/gallium/auxiliary/util/u_blit.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c
index efc3a874cc..4cc720269d 100644
--- a/src/gallium/auxiliary/util/u_blit.c
+++ b/src/gallium/auxiliary/util/u_blit.c
@@ -199,7 +199,6 @@ static unsigned
setup_vertex_data(struct blit_state *ctx,
float x0, float y0, float x1, float y1, float z)
{
- void *buf;
unsigned offset;
ctx->vertices[0][0][0] = x0;
@@ -228,12 +227,8 @@ setup_vertex_data(struct blit_state *ctx,
offset = get_next_slot( ctx );
- buf = pipe_buffer_map(ctx->pipe->screen, ctx->vbuf,
- PIPE_BUFFER_USAGE_CPU_WRITE);
-
- memcpy((char *)buf + offset, ctx->vertices, sizeof(ctx->vertices));
-
- pipe_buffer_unmap(ctx->pipe->screen, ctx->vbuf);
+ pipe_buffer_write(ctx->pipe->screen, ctx->vbuf,
+ offset, sizeof(ctx->vertices), ctx->vertices);
return offset;
}
@@ -249,7 +244,6 @@ setup_vertex_data_tex(struct blit_state *ctx,
float s0, float t0, float s1, float t1,
float z)
{
- void *buf;
unsigned offset;
ctx->vertices[0][0][0] = x0;
@@ -278,12 +272,8 @@ setup_vertex_data_tex(struct blit_state *ctx,
offset = get_next_slot( ctx );
- buf = pipe_buffer_map(ctx->pipe->screen, ctx->vbuf,
- PIPE_BUFFER_USAGE_CPU_WRITE);
-
- memcpy((char *)buf + offset, ctx->vertices, sizeof(ctx->vertices));
-
- pipe_buffer_unmap(ctx->pipe->screen, ctx->vbuf);
+ pipe_buffer_write(ctx->pipe->screen, ctx->vbuf,
+ offset, sizeof(ctx->vertices), ctx->vertices);
return offset;
}