zink: turn off threaded cpu access if not visible.
authorDave Airlie <airlied@redhat.com>
Mon, 7 Aug 2023 22:32:54 +0000 (08:32 +1000)
committerMarge Bot <emma+marge@anholt.net>
Tue, 8 Aug 2023 05:06:11 +0000 (05:06 +0000)
This turns off the threaded cpu access it the resource isn't visible.

Fixes a bunch of crashes with current nvk.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24548>

src/gallium/drivers/zink/zink_resource.c

index c1774b9..888bee5 100644 (file)
@@ -1487,8 +1487,10 @@ resource_create(struct pipe_screen *pscreen,
       res->swapchain = true;
    }
 
-   if (!res->obj->host_visible)
+   if (!res->obj->host_visible) {
       res->base.b.flags |= PIPE_RESOURCE_FLAG_DONT_MAP_DIRECTLY;
+      res->base.allow_cpu_storage = false;
+   }
    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);