zink: explicitly eliminate feedback loops for unused zsbufs

this avoids a GENERAL/FEEDBACK_LOOP layout transition where possible

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>
This commit is contained in:
Mike Blumenkrantz 2023-03-17 09:51:53 -04:00 committed by Marge Bot
parent 618c3651ff
commit a702e5038c

View file

@ -5651,6 +5651,9 @@ add_implicit_feedback_loop(struct zink_context *ctx, struct zink_resource *res)
/* can only feedback loop with fb+sampler bind; image bind must be GENERAL */
if (!res->fb_bind_count || !res->sampler_bind_count[0] || res->image_bind_count[0])
return false;
/* if zsbuf isn't used then it effectively has no fb binds */
if (!(res->aspect & VK_IMAGE_ASPECT_COLOR_BIT) && !zink_is_zsbuf_used(ctx))
return false;
bool is_feedback = false;
/* avoid false positives when a texture is bound but not used */
u_foreach_bit(vkstage, res->gfx_barrier) {