From a1acbaea39a69a4a732b5aa16a103e41585ce7f2 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 19 Jun 2023 11:05:13 -0400 Subject: [PATCH] zink: acquire persistently bound swapchain descriptors before setting usage if a swapchain image is bound as a sampler across batches then it needs to be acquired again before it is used cc: mesa-stable Part-of: (cherry picked from commit 6b204c616223b2742e120218676f9d5575dd4cc0) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_context.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 495b1d7d2c6..cbd43f02ffc 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -67,7 +67,7 @@ "description": "zink: acquire persistently bound swapchain descriptors before setting usage", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index f72d50e32e1..03d1959b608 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -3121,6 +3121,11 @@ update_resource_refs_for_stage(struct zink_context *ctx, gl_shader_stage stage) continue; bool is_buffer = res->obj->is_buffer; bool is_write = zink_resource_access_is_write(get_access_flags_for_binding(ctx, i, stage, j)); + if (zink_is_swapchain(res)) { + if (!zink_kopper_acquire(ctx, res, UINT64_MAX)) + /* technically this is a failure condition, but there's no safe way out */ + continue; + } zink_batch_resource_usage_set(batch, res, is_write, is_buffer); if (is_write || !res->obj->is_buffer) res->obj->unordered_read = res->obj->unordered_write = false;