Mesa (main): zink: use only the extents for buffer unmap flushes

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 17 01:13:22 UTC 2022


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu Jun 16 14:56:32 2022 -0400

zink: use only the extents for buffer unmap flushes

flush_region is relative to the map, so passing in the offsets again
breaks the flush (if the flush hook is implemented correctly)

cc: mesa-stable

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

---

 src/gallium/drivers/zink/zink_resource.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c
index bea54ac9fcd..8a59a529fcf 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -2009,7 +2009,10 @@ transfer_unmap(struct pipe_context *pctx, struct pipe_transfer *ptrans)
    struct zink_transfer *trans = (struct zink_transfer *)ptrans;
 
    if (!(trans->base.b.usage & (PIPE_MAP_FLUSH_EXPLICIT | PIPE_MAP_COHERENT))) {
-      zink_transfer_flush_region(pctx, ptrans, &ptrans->box);
+      /* flush_region is relative to the mapped region: use only the extents */
+      struct pipe_box box = ptrans->box;
+      box.x = box.y = box.z = 0;
+      zink_transfer_flush_region(pctx, ptrans, &box);
    }
 
    if ((trans->base.b.usage & PIPE_MAP_PERSISTENT) && !(trans->base.b.usage & PIPE_MAP_COHERENT))



More information about the mesa-commit mailing list