Mesa (main): zink: set PIPE_RESOURCE_FLAG_DONT_MAP_DIRECTLY for device-local resources

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 29 04:56:56 UTC 2022


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Wed Jun 22 09:35:18 2022 -0400

zink: set PIPE_RESOURCE_FLAG_DONT_MAP_DIRECTLY for device-local resources

these can't be mapped, so ensure tc doesn't try to pass UNSYNCHRONIZED
maps and break the resources

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

---

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

diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c
index 0bedd2cf194..092a2487ff5 100644
--- a/src/gallium/drivers/zink/zink_resource.c
+++ b/src/gallium/drivers/zink/zink_resource.c
@@ -1141,6 +1141,8 @@ resource_create(struct pipe_screen *pscreen,
       res->optimal_tiling = true;
       res->swapchain = true;
    }
+   if (!res->obj->host_visible)
+      res->base.b.flags |= PIPE_RESOURCE_FLAG_DONT_MAP_DIRECTLY;
    if (res->obj->is_buffer) {
       res->base.buffer_id_unique = util_idalloc_mt_alloc(&screen->buffer_ids);
       _mesa_hash_table_init(&res->bufferview_cache, NULL, NULL, equals_bvci);



More information about the mesa-commit mailing list