gallium/u_threaded: fix EXPLICIT_FLUSH for flush offsets > 0
authorMarek Olšák <marek.olsak@amd.com>
Fri, 1 Feb 2019 22:10:46 +0000 (17:10 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 11 Feb 2019 17:35:04 +0000 (12:35 -0500)
Cc: 18.3 19.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/auxiliary/util/u_threaded_context.c

index 8e3bceae18d0b983e20cb2dd62587b3fdd6a2c10..b596c3229189e7fe3923ed7088ece58676b30ec3 100644 (file)
@@ -1524,7 +1524,8 @@ tc_buffer_do_flush_region(struct threaded_context *tc,
    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. */