diff options
author | Marek Olšák <[email protected]> | 2010-12-25 14:48:34 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2010-12-25 16:07:13 +0100 |
commit | b606c8a015a0e304110b48c81b3bf06701f6cae1 (patch) | |
tree | cb25cbe960a5dde32b84228f6c078dea0142073b /src/gallium | |
parent | 7e752760d410e72cc766691bee207729f28a920a (diff) |
r300g: simplify buffer_transfer_inline_write
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/r300/r300_screen_buffer.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c index 1bf922ef351..565ead21711 100644 --- a/src/gallium/drivers/r300/r300_screen_buffer.c +++ b/src/gallium/drivers/r300/r300_screen_buffer.c @@ -248,26 +248,26 @@ static void r300_buffer_transfer_inline_write(struct pipe_context *pipe, unsigned stride, unsigned layer_stride) { + struct r300_context *r300 = r300_context(pipe); + struct r300_winsys_screen *rws = r300->screen->rws; struct r300_buffer *rbuf = r300_buffer(resource); - struct pipe_transfer *transfer = NULL; uint8_t *map = NULL; if (rbuf->constant_buffer) { memcpy(rbuf->constant_buffer + box->x, data, box->width); return; } + assert(rbuf->user_buffer == NULL); - transfer = r300_buffer_get_transfer(pipe, resource, 0, - PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD, box); - map = r300_buffer_transfer_map(pipe, transfer); + map = rws->buffer_map(rws, rbuf->buf, r300->cs, + PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD | usage); - memcpy(map, data, box->width); + memcpy(map + box->x, data, box->width); - r300_buffer_transfer_unmap(pipe, transfer); - r300_buffer_transfer_destroy(pipe, transfer); + rws->buffer_unmap(rws, rbuf->buf); } -struct u_resource_vtbl r300_buffer_vtbl = +struct u_resource_vtbl r300_buffer_vtbl = { u_default_resource_get_handle, /* get_handle */ r300_buffer_destroy, /* resource_destroy */ |