diff options
author | Marek Olšák <[email protected]> | 2012-05-11 17:34:26 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-05-11 17:36:11 +0200 |
commit | d3bab0c7bee7439fa834fd86a835119fc5fa3307 (patch) | |
tree | 0f7aa37a2b48c9f42fc08df0226c5b718c745ee1 /src/gallium/drivers/r600/r600_buffer.c | |
parent | 7435c043988dd83b430f3d3a7ca5a5a1b2f30d61 (diff) |
r600g: assume DISCARD_WHOLE_RESOURCE is always used with WRITE
Diffstat (limited to 'src/gallium/drivers/r600/r600_buffer.c')
-rw-r--r-- | src/gallium/drivers/r600/r600_buffer.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/gallium/drivers/r600/r600_buffer.c b/src/gallium/drivers/r600/r600_buffer.c index 0ca6ff114b4..857d860aaea 100644 --- a/src/gallium/drivers/r600/r600_buffer.c +++ b/src/gallium/drivers/r600/r600_buffer.c @@ -86,14 +86,13 @@ static void *r600_buffer_transfer_map(struct pipe_context *pipe, struct r600_context *rctx = (struct r600_context*)pipe; uint8_t *data; - if (transfer->usage & PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE) { - /* When mapping for read, we only need to check if the GPU is writing to it. */ - enum radeon_bo_usage rusage = transfer->usage & PIPE_TRANSFER_WRITE ? - RADEON_USAGE_READWRITE : RADEON_USAGE_WRITE; + if (transfer->usage & PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE && + !(transfer->usage & PIPE_TRANSFER_UNSYNCHRONIZED)) { + assert(transfer->usage & PIPE_TRANSFER_WRITE); /* Check if mapping this buffer would cause waiting for the GPU. */ - if (rctx->ws->cs_is_buffer_referenced(rctx->cs, rbuffer->cs_buf, rusage) || - rctx->ws->buffer_is_busy(rbuffer->buf, rusage)) { + if (rctx->ws->cs_is_buffer_referenced(rctx->cs, rbuffer->cs_buf, RADEON_USAGE_READWRITE) || + rctx->ws->buffer_is_busy(rbuffer->buf, RADEON_USAGE_READWRITE)) { unsigned i; /* Discard the buffer. */ |