From 6ba5ef79df69b007c616c316061604ef385e1978 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 17 Apr 2024 12:26:05 -0400 Subject: [PATCH] zink: disable buffer reordering correctly on shader image binds the unordered flags must be set after the barrier to avoid the scenario where the barrier checks buffer usage and resets the flags cc: mesa-stable Part-of: (cherry picked from commit 974b3ab9642cb8054b27261fe4a62e0f0c1adb84) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_context.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 22b18b70b55..109f978da96 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1504,7 +1504,7 @@ "description": "zink: disable buffer reordering correctly on shader image binds", "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_context.c b/src/gallium/drivers/zink/zink_context.c index e359f3ebe44..d58293109ac 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1947,9 +1947,6 @@ zink_set_shader_images(struct pipe_context *pctx, /* ref already added by create */ a->buffer_view = bv; } - if (zink_resource_access_is_write(access)) - res->obj->unordered_write = false; - res->obj->unordered_read = false; } else { /* image rebind: get updated surface and unref old one */ struct zink_surface *surface = create_image_surface(ctx, b, is_compute); @@ -1969,6 +1966,9 @@ zink_set_shader_images(struct pipe_context *pctx, res->gfx_barrier); zink_batch_resource_usage_set(&ctx->batch, res, zink_resource_access_is_write(access), true); + if (zink_resource_access_is_write(access)) + res->obj->unordered_write = false; + res->obj->unordered_read = false; } else { finalize_image_bind(ctx, res, is_compute); zink_batch_resource_usage_set(&ctx->batch, res,