summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-02-01 17:10:46 -0500
committerDylan Baker <[email protected]>2019-02-12 14:19:52 -0800
commit62b3bd8cd1dfe95a0d7a874a7df25aa09215999a (patch)
tree0b61ccbd362640729a0ac051b6f074b89e3628fd
parentfb3485bc9248a12f47b07b593f0a81d58cbb3155 (diff)
radeonsi: fix EXPLICIT_FLUSH for flush offsets > 0
Cc: 18.3 19.0 <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> (cherry picked from commit 61c678d4bc91d2ff9ca8c9b183e08daf07d8d24c)
-rw-r--r--src/gallium/drivers/radeonsi/si_buffer.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeonsi/si_buffer.c b/src/gallium/drivers/radeonsi/si_buffer.c
index 03c11cb7013..3845e56a4b3 100644
--- a/src/gallium/drivers/radeonsi/si_buffer.c
+++ b/src/gallium/drivers/radeonsi/si_buffer.c
@@ -521,10 +521,13 @@ static void si_buffer_do_flush_region(struct pipe_context *ctx,
struct si_resource *buf = si_resource(transfer->resource);
if (stransfer->staging) {
+ unsigned src_offset = stransfer->offset +
+ transfer->box.x % SI_MAP_BUFFER_ALIGNMENT +
+ (box->x - transfer->box.x);
+
/* Copy the staging buffer into the original one. */
si_copy_buffer((struct si_context*)ctx, transfer->resource,
- &stransfer->staging->b.b, box->x,
- stransfer->offset + box->x % SI_MAP_BUFFER_ALIGNMENT,
+ &stransfer->staging->b.b, box->x, src_offset,
box->width);
}