Module: Mesa
Branch: main
Commit: 4c359f785ff426c2e9ee7027f2fee44bbcca8c63
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4c359f785ff426c2e9ee7027f2fee44bbcca8c63

Author: Mike Blumenkrantz <[email protected]>
Date:   Wed Mar 15 19:16:17 2023 -0400

zink: trigger oom flushes more aggressively from copy ops

this cuts down on needing to flush from set_fb or draw

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21800>

---

 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

Reply via email to