From 442281447af39e8f1a0d5a3edeca9fc1b5fb41b3 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 6 Jul 2022 08:43:56 -0400 Subject: [PATCH] zink: remove u_blitter usage from zink_clear_render_target this is more operations than needed Acked-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_clear.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/zink/zink_clear.c b/src/gallium/drivers/zink/zink_clear.c index aa9fa3a510d..9f38e728238 100644 --- a/src/gallium/drivers/zink/zink_clear.c +++ b/src/gallium/drivers/zink/zink_clear.c @@ -505,10 +505,19 @@ zink_clear_render_target(struct pipe_context *pctx, struct pipe_surface *dst, bool render_condition_enabled) { struct zink_context *ctx = zink_context(pctx); - zink_blit_begin(ctx, ZINK_BLIT_SAVE_FB | ZINK_BLIT_SAVE_FS | (render_condition_enabled ? 0 : ZINK_BLIT_NO_COND_RENDER)); - util_blitter_clear_render_target(ctx->blitter, dst, color, dstx, dsty, width, height); - if (!render_condition_enabled && ctx->render_condition_active) + bool render_condition_active = ctx->render_condition_active; + if (!render_condition_enabled && render_condition_active) { + zink_stop_conditional_render(ctx); + ctx->render_condition_active = false; + } + util_blitter_save_framebuffer(ctx->blitter, &ctx->fb_state); + set_clear_fb(pctx, dst, NULL); + struct pipe_scissor_state scissor = {dstx, dsty, dstx + width, dsty + height}; + pctx->clear(pctx, PIPE_CLEAR_COLOR0, &scissor, color, 0, 0); + util_blitter_restore_fb_state(ctx->blitter); + if (!render_condition_enabled && render_condition_active) zink_start_conditional_render(ctx); + ctx->render_condition_active = render_condition_active; } void