gallium: Add pipe_buffer_write/read inlines.

Saves code, and will simplify future interface changes.
This commit is contained in:
José Fonseca
2009-02-24 11:30:25 +00:00
parent c5dd8634c8
commit 693fac8ae2
8 changed files with 60 additions and 58 deletions

View File

@@ -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);
}