From: Mike Blumenkrantz Date: Mon, 21 Jun 2021 15:25:04 +0000 (-0400) Subject: zink: clear the fb clears array instead of freeing it on reset X-Git-Tag: upstream/21.2.3~1551 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84199077d95f6c3022acc04e0f654b5476620aa8;p=platform%2Fupstream%2Fmesa.git zink: clear the fb clears array instead of freeing it on reset this cuts cpu usage by ~2% in sourcemark due to not reallocating the array on every draw Reviewed-by: Hoe Hao Cheng Part-of: --- diff --git a/src/gallium/drivers/zink/zink_clear.c b/src/gallium/drivers/zink/zink_clear.c index bf38e97..21d5b34 100644 --- a/src/gallium/drivers/zink/zink_clear.c +++ b/src/gallium/drivers/zink/zink_clear.c @@ -578,7 +578,7 @@ fb_clears_apply_internal(struct zink_context *ctx, struct pipe_resource *pres, i void zink_fb_clear_reset(struct zink_context *ctx, unsigned i) { - util_dynarray_fini(&ctx->fb_clears[i].clears); + util_dynarray_clear(&ctx->fb_clears[i].clears); if (i == PIPE_MAX_COLOR_BUFS) { ctx->clears_enabled &= ~PIPE_CLEAR_DEPTHSTENCIL; ctx->rp_clears_enabled &= ~PIPE_CLEAR_DEPTHSTENCIL;