summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2023-02-24 11:03:57 -0500
committerEric Engestrom <eric@engestrom.ch>2023-03-08 18:00:12 +0000
commit0759f1b56cb59ea1863e52148eaff3764cf2806f (patch)
treebfbf2dcff602275ed97eb72ba6682f43cc23f0ab
parent5716f6b1e8052a5b86fbc644768e95d27564247e (diff)
downloadmesa-0759f1b56cb59ea1863e52148eaff3764cf2806f.tar.gz
zink: fix shader read access removal for barrier generation
barrier access is based on total binds per gfx/compute, not per stage cc: mesa-stable Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21522> (cherry picked from commit ddb116d75517070876155bb5e050b66eaa96fa8f)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/drivers/zink/zink_context.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/.pick_status.json b/.pick_status.json
index b5c28459518..0d89288afa4 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -5539,7 +5539,7 @@
"description": "zink: fix shader read access removal for barrier generation",
"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 c98a32ac207..46aca386eb9 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1442,8 +1442,9 @@ zink_set_constant_buffer(struct pipe_context *pctx,
ALWAYS_INLINE static void
unbind_descriptor_reads(struct zink_resource *res, gl_shader_stage pstage)
{
- if (!res->sampler_binds[pstage] && !res->image_binds[pstage])
- res->barrier_access[pstage == MESA_SHADER_COMPUTE] &= ~VK_ACCESS_SHADER_READ_BIT;
+ bool is_compute = pstage == MESA_SHADER_COMPUTE;
+ if (!res->sampler_bind_count[is_compute] && !res->image_bind_count[is_compute])
+ res->barrier_access[is_compute] &= ~VK_ACCESS_SHADER_READ_BIT;
}
ALWAYS_INLINE static void