Mesa (main): zink: stop screwing up buffer offsets during for maps

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jul 2 03:39:43 UTC 2021


Module: Mesa
Branch: main
Commit: 347163aec25f8f5374f1cd3a94f9222099680680
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=347163aec25f8f5374f1cd3a94f9222099680680

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Mon May 17 17:46:01 2021 -0400

zink: stop screwing up buffer offsets during for maps

stop using the memory bind offset

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11687>

---

 src/gallium/drivers/zink/zink_resource.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c
index 455954e98f6..0691277edc3 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -933,7 +933,6 @@ buffer_transfer_map(struct zink_context *ctx, struct zink_resource *res, unsigne
          if (!trans->staging_res)
             return NULL;
          struct zink_resource *staging_res = zink_resource(trans->staging_res);
-         trans->offset = staging_res->obj->offset;
          zink_copy_buffer(ctx, NULL, staging_res, res, box->x, box->x, box->width);
          res = staging_res;
          zink_fence_wait(&ctx->base);
@@ -1142,7 +1141,7 @@ zink_transfer_flush_region(struct pipe_context *pctx,
          struct zink_resource *staging_res = zink_resource(trans->staging_res);
 
          if (ptrans->resource->target == PIPE_BUFFER)
-            zink_copy_buffer(ctx, NULL, res, staging_res, box->x, box->x + trans->offset + m->obj->offset, box->width);
+            zink_copy_buffer(ctx, NULL, res, staging_res, box->x, offset, box->width);
          else
             zink_transfer_copy_bufimage(ctx, res, staging_res, trans);
       }



More information about the mesa-commit mailing list