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