diff options
author | Marek Olšák <[email protected]> | 2011-12-24 11:43:10 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-12-24 21:28:43 +0100 |
commit | ec4851253bbf7fd7d11c5570f19f9733a885e471 (patch) | |
tree | ec1af7e40b0b00b9f3dd81dc57ebc837a6093778 | |
parent | 93f4e3cb6c1ca303ee1f5c2a2491a8eff33f2633 (diff) |
r300g: mapping buffers for read should be unsynchronized
The GPU never uses them for write.
-rw-r--r-- | src/gallium/drivers/r300/r300_screen_buffer.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c index a8392d2dc52..2e9e7d7f408 100644 --- a/src/gallium/drivers/r300/r300_screen_buffer.c +++ b/src/gallium/drivers/r300/r300_screen_buffer.c @@ -107,13 +107,21 @@ r300_buffer_transfer_map( struct pipe_context *pipe, struct radeon_winsys *rws = r300screen->rws; struct r300_resource *rbuf = r300_resource(transfer->resource); uint8_t *map; + enum pipe_transfer_usage usage; if (rbuf->b.user_ptr) return (uint8_t *) rbuf->b.user_ptr + transfer->box.x; if (rbuf->constant_buffer) return (uint8_t *) rbuf->constant_buffer + transfer->box.x; - map = rws->buffer_map(rbuf->buf, r300->cs, transfer->usage); + /* Buffers are never used for write, therefore mapping for read can be + * unsynchronized. */ + usage = transfer->usage; + if (!(usage & PIPE_TRANSFER_WRITE)) { + usage |= PIPE_TRANSFER_UNSYNCHRONIZED; + } + + map = rws->buffer_map(rbuf->buf, r300->cs, usage); if (map == NULL) return NULL; |