From 4c359f785ff426c2e9ee7027f2fee44bbcca8c63 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 15 Mar 2023 19:16:17 -0400 Subject: [PATCH] zink: trigger oom flushes more aggressively from copy ops this cuts down on needing to flush from set_fb or draw Part-of: --- src/gallium/drivers/zink/zink_context.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index b66ad4e934d..69e8b62844e 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -4835,6 +4835,9 @@ zink_copy_image_buffer(struct zink_context *ctx, struct zink_resource *dst, stru } if (needs_present_readback) zink_kopper_present_readback(ctx, img); + + if (ctx->oom_flush && !ctx->batch.in_rp) + flush_batch(ctx, false); } static void @@ -4945,6 +4948,8 @@ zink_resource_copy_region(struct pipe_context *pctx, zink_copy_buffer(ctx, dst, src, dstx, src_box->x, src_box->width); } else zink_copy_image_buffer(ctx, dst, src, dst_level, dstx, dsty, dstz, src_level, src_box, 0); + if (ctx->oom_flush && !ctx->batch.in_rp) + flush_batch(ctx, false); } static bool