zink: only do deferred image barriers if layout changes

otherwise these should be handled by apps using glMemoryBarrier

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11590>
This commit is contained in:
Mike Blumenkrantz 2021-04-09 10:30:49 -04:00 committed by Marge Bot
parent d3b7b35584
commit e8a188a86e
1 changed files with 2 additions and 1 deletions

View File

@ -377,7 +377,8 @@ update_barriers(struct zink_context *ctx, bool is_compute)
zink_resource_buffer_barrier(ctx, NULL, res, access, pipeline);
else {
VkImageLayout layout = zink_descriptor_util_image_layout_eval(res, is_compute);
zink_resource_image_barrier(ctx, NULL, res, layout, access, pipeline);
if (layout != res->layout)
zink_resource_image_barrier(ctx, NULL, res, layout, access, pipeline);
}
/* always barrier on draw if this resource has either multiple image write binds or
* image write binds and image read binds