From a702e5038c771f4038301aa292e08b976d70f5cc Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 17 Mar 2023 09:51:53 -0400 Subject: [PATCH] zink: explicitly eliminate feedback loops for unused zsbufs this avoids a GENERAL/FEEDBACK_LOOP layout transition where possible Part-of: --- src/gallium/drivers/zink/zink_context.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index b531161..290a7dd 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -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) { -- 2.7.4