From: Marek Olšák <marek.ol...@amd.com>

Cc: 18.3 19.0 <mesa-sta...@lists.freedesktop.org>
---
 src/gallium/auxiliary/util/u_threaded_context.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/util/u_threaded_context.c 
b/src/gallium/auxiliary/util/u_threaded_context.c
index 8e3bceae18d..b596c322918 100644
--- a/src/gallium/auxiliary/util/u_threaded_context.c
+++ b/src/gallium/auxiliary/util/u_threaded_context.c
@@ -1517,21 +1517,22 @@ tc_resource_copy_region(struct pipe_context *_pipe,
 static void
 tc_buffer_do_flush_region(struct threaded_context *tc,
                           struct threaded_transfer *ttrans,
                           const struct pipe_box *box)
 {
    struct threaded_resource *tres = threaded_resource(ttrans->b.resource);
 
    if (ttrans->staging) {
       struct pipe_box src_box;
 
-      u_box_1d(ttrans->offset + box->x % tc->map_buffer_alignment,
+      u_box_1d(ttrans->offset + ttrans->b.box.x % tc->map_buffer_alignment +
+               (box->x - ttrans->b.box.x),
                box->width, &src_box);
 
       /* Copy the staging buffer into the original one. */
       tc_resource_copy_region(&tc->base, ttrans->b.resource, 0, box->x, 0, 0,
                               ttrans->staging, 0, &src_box);
    }
 
    util_range_add(tres->base_valid_buffer_range, box->x, box->x + box->width);
 }
 
-- 
2.17.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to