Module: Mesa Branch: main Commit: 5c2df10f1048899b4007b990d219f66722976642 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5c2df10f1048899b4007b990d219f66722976642
Author: Mike Blumenkrantz <[email protected]> Date: Tue Sep 14 09:33:04 2021 -0400 zink: don't add resource to pending barrier set if no barrier will be generated Reviewed-by: Dave Airlie <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12855> --- src/gallium/drivers/zink/zink_context.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 6b75deca6d8..fe873ac5536 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -1246,9 +1246,9 @@ check_for_layout_update(struct zink_context *ctx, struct zink_resource *res, boo { VkImageLayout layout = res->bind_count[is_compute] ? zink_descriptor_util_image_layout_eval(res, is_compute) : VK_IMAGE_LAYOUT_UNDEFINED; VkImageLayout other_layout = res->bind_count[!is_compute] ? zink_descriptor_util_image_layout_eval(res, !is_compute) : VK_IMAGE_LAYOUT_UNDEFINED; - if (res->bind_count[is_compute] && res->layout != layout) + if (res->bind_count[is_compute] && layout && res->layout != layout) _mesa_set_add(ctx->need_barriers[is_compute], res); - if (res->bind_count[!is_compute] && (layout != other_layout || res->layout != other_layout)) + if (res->bind_count[!is_compute] && other_layout && (layout != other_layout || res->layout != other_layout)) _mesa_set_add(ctx->need_barriers[!is_compute], res); }
