Mesa (main): zink: never use staging buffer for unsynchronized buffer maps

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 28 21:25:52 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Tue Jun 15 16:18:47 2021 -0400

zink: never use staging buffer for unsynchronized buffer maps

this is ultra broken, do not attempt

Fixes: 6bfbce0447b ("zink: rework buffer mapping")

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

---

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

diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c
index 9ed73cf72b8..d717e7ed4af 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -1190,7 +1190,8 @@ buffer_transfer_map(struct zink_context *ctx, struct zink_resource *res, unsigne
          /* At this point, the buffer is always idle (we checked it above). */
          usage |= PIPE_MAP_UNSYNCHRONIZED;
       }
-   } else if (((usage & PIPE_MAP_READ) && !(usage & PIPE_MAP_PERSISTENT) && res->base.b.usage != PIPE_USAGE_STAGING) || !res->obj->host_visible) {
+   } else if (!(usage & PIPE_MAP_UNSYNCHRONIZED) &&
+              (((usage & PIPE_MAP_READ) && !(usage & PIPE_MAP_PERSISTENT) && res->base.b.usage != PIPE_USAGE_STAGING) || !res->obj->host_visible)) {
       assert(!(usage & (TC_TRANSFER_MAP_THREADED_UNSYNC | PIPE_MAP_THREAD_SAFE)));
       if (!res->obj->host_visible || !(usage & PIPE_MAP_ONCE)) {
          trans->offset = box->x % screen->info.props.limits.minMemoryMapAlignment;



More information about the mesa-commit mailing list