From a60992ccead62696a935b1e445d8034ed073791c Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 8 Aug 2023 08:32:54 +1000 Subject: [PATCH] zink: turn off threaded cpu access if not visible. 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 Cc: mesa-stable Part-of: (cherry picked from commit ae6be7a44a24bc96f00d7510ccc1815efa84c6eb) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_resource.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index efb1237992f..c7866cd4e5d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -10054,7 +10054,7 @@ "description": "zink: turn off threaded cpu access if not visible.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c index c1774b90f1d..888bee50774 100644 --- a/src/gallium/drivers/zink/zink_resource.c +++ b/src/gallium/drivers/zink/zink_resource.c @@ -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);