From: Mike Blumenkrantz Date: Fri, 7 Apr 2023 21:06:45 +0000 (-0400) Subject: zink: try to prune resources from barrier jit on fb unbind X-Git-Tag: upstream/23.3.3~10239 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=75a7dcf35faab45c5cd09f030f7ac9ef682872d9;p=platform%2Fupstream%2Fmesa.git zink: try to prune resources from barrier jit on fb unbind if a resource has no binds remaining then it should not remain in the queue for barrier updates on the next draw cc: mesa-stable Part-of: --- diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 446cf1b..144ce2e 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -3252,6 +3252,8 @@ unbind_fb_surface(struct zink_context *ctx, struct pipe_surface *surf, unsigned ctx->rp_changed = true; } res->fb_bind_count--; + if (!res->fb_bind_count && !res->bind_count[0]) + _mesa_set_remove_key(ctx->need_barriers[0], res); unsigned feedback_loops = ctx->feedback_loops; if (ctx->feedback_loops & BITFIELD_BIT(idx)) { ctx->dynamic_fb.attachments[idx].imageLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;