[Mesa-dev] [PATCH 6/8] gallium/radeon: reset valid_buffer_range on PIPE_TRANSFER_DISCARD_WHOLE_RESOURCE

Nicolai Hähnle nhaehnle at gmail.com
Tue Jan 12 08:06:28 PST 2016


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

This accomodates a streaming pattern where the discard flag is set when the
application wraps back to the beginning of the buffer.
---
 src/gallium/drivers/radeon/r600_buffer_common.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c
index 484f5c8..aeb9a20 100644
--- a/src/gallium/drivers/radeon/r600_buffer_common.c
+++ b/src/gallium/drivers/radeon/r600_buffer_common.c
@@ -280,7 +280,10 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
 		if (r600_rings_is_buffer_referenced(rctx, rbuffer->buf, RADEON_USAGE_READWRITE) ||
 		    !rctx->ws->buffer_wait(rbuffer->buf, 0, RADEON_USAGE_READWRITE)) {
 			rctx->invalidate_buffer(&rctx->b, &rbuffer->b.b);
+		} else {
+			util_range_set_empty(&rbuffer->valid_buffer_range);
 		}
+
 		/* At this point, the buffer is always idle. */
 		usage |= PIPE_TRANSFER_UNSYNCHRONIZED;
 	}
-- 
2.5.0



More information about the mesa-dev mailing list