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@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17095>
(cherry picked from commit 28d23c9e26)
This commit is contained in:
Mike Blumenkrantz 2022-06-16 14:56:32 -04:00 committed by Dylan Baker
parent c92f4bfffd
commit c549cb7aa1
2 changed files with 5 additions and 2 deletions

View file

@ -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
},

View file

@ -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))