diff options
author | Mike Blumenkrantz <michael.blumenkrantz@gmail.com> | 2023-03-06 08:25:00 -0500 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2023-03-08 18:00:16 +0000 |
commit | bd0217cace3f0cd715fb7e4a64c0316a498a1165 (patch) | |
tree | ba5e09a7b0d8ec6cb1c4d358c9e58a27adf6e7e7 | |
parent | 4585f21de47af5e2b1a018a052ac0aaf5f1f3ac5 (diff) | |
download | mesa-bd0217cace3f0cd715fb7e4a64c0316a498a1165.tar.gz |
zink: only add deferred barrier on fb unbind when layout needs to change
this otherwise may have been a surface that was never drawn to or
already had its layout corrected, in which case a deferred barrier
is not only unnecessary, it might be broken
cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
(cherry picked from commit e0dfe058c4c86e23569d82adc75369d5930d8a1a)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/gallium/drivers/zink/zink_context.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json index cd158b078cf..f1168bb1345 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1210,7 +1210,7 @@ "description": "zink: only add deferred barrier on fb unbind when layout needs to change", "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 4bc9ec51c4a..452ac0a16fc 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -2898,7 +2898,8 @@ unbind_fb_surface(struct zink_context *ctx, struct pipe_surface *surf, unsigned check_resource_for_batch_ref(ctx, res); if (res->sampler_bind_count[0]) { update_res_sampler_layouts(ctx, res); - _mesa_set_add(ctx->need_barriers[0], res); + if (res->layout != VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL) + _mesa_set_add(ctx->need_barriers[0], res); } } } |