From c549cb7aa1ca519a1330fe40ea41745db3a868b7 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 16 Jun 2022 14:56:32 -0400 Subject: [PATCH] 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 Part-of: (cherry picked from commit 28d23c9e2614fef5b468674ca9cd6b430d869d95) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_resource.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 4572920a812..91100d5b859 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -103,7 +103,7 @@ "description": "zink: use only the extents for buffer unmap flushes", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c index 269efbe4d6c..c2198b8e6a4 100644 --- a/src/gallium/drivers/zink/zink_resource.c +++ b/src/gallium/drivers/zink/zink_resource.c @@ -1860,7 +1860,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))