summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_atom_constbuf.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/mesa/state_tracker/st_atom_constbuf.c
parentc5dd8634c8d3487a171cd129c2b7ac6e205e72a7 (diff)
gallium: Add pipe_buffer_write/read inlines.
Saves code, and will simplify future interface changes.
Diffstat (limited to 'src/mesa/state_tracker/st_atom_constbuf.c')
-rw-r--r--src/mesa/state_tracker/st_atom_constbuf.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c
index 514b10cd02..2df6fef210 100644
--- a/src/mesa/state_tracker/st_atom_constbuf.c
+++ b/src/mesa/state_tracker/st_atom_constbuf.c
@@ -85,12 +85,10 @@ void st_upload_constants( struct st_context *st,
}
/* load Mesa constants into the constant buffer */
- if (cbuf->buffer) {
- void *map = pipe_buffer_map(pipe->screen, cbuf->buffer,
- PIPE_BUFFER_USAGE_CPU_WRITE);
- memcpy(map, params->ParameterValues, paramBytes);
- pipe_buffer_unmap(pipe->screen, cbuf->buffer);
- }
+ if (cbuf->buffer)
+ pipe_buffer_write(pipe->screen, cbuf->buffer,
+ 0, paramBytes,
+ params->ParameterValues);
st->pipe->set_constant_buffer(st->pipe, id, 0, cbuf);
}