summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorBruno JimĂ©nez <[email protected]>2014-06-18 17:01:58 +0200
committerTom Stellard <[email protected]>2014-06-20 13:44:08 -0400
commit257d697fb92c617161a2a90607c4cde6f7b9034a (patch)
treefe86c2ff1955a7853ef34cd392c8ae18360c20bc /src/gallium/drivers
parent9b933b73a9baf6031e5974fc2aa76011a50949d3 (diff)
r600g/compute: Map only against intermediate buffers
With this we can assure that mapped buffers will never change its position when relocating the pool. This patch should finally solve the mapping bug. v2: Use the new is_item_in_pool util function, as suggested by Tom Stellard Reviewed-by: Tom Stellard <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/r600/evergreen_compute.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gallium/drivers/r600/evergreen_compute.c b/src/gallium/drivers/r600/evergreen_compute.c
index 8657071e4c6..c0dd0f34914 100644
--- a/src/gallium/drivers/r600/evergreen_compute.c
+++ b/src/gallium/drivers/r600/evergreen_compute.c
@@ -970,14 +970,12 @@ void *r600_compute_global_transfer_map(
struct pipe_resource *dst;
unsigned offset = box->x;
- if (buffer->chunk->real_buffer) {
- dst = (struct pipe_resource*)buffer->chunk->real_buffer;
- }
- else {
- dst = (struct pipe_resource*)buffer->chunk->pool->bo;
- offset += (buffer->chunk->start_in_dw * 4);
+ if (is_item_in_pool(buffer->chunk)) {
+ compute_memory_demote_item(pool, buffer->chunk, ctx_);
}
+ dst = (struct pipe_resource*)buffer->chunk->real_buffer;
+
if (usage & PIPE_TRANSFER_READ)
buffer->chunk->status |= ITEM_MAPPED_FOR_READING;