From: SoroushIMG Date: Sun, 5 Feb 2023 15:43:45 +0000 (+0000) Subject: zink: only save frag const buffers when used by blit X-Git-Tag: upstream/22.3.5~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=21e6f53a689fe78609d643295df7cf2aacd9503e;p=platform%2Fupstream%2Fmesa.git zink: only save frag const buffers when used by blit fixes upload manager constant buffer leak. zink only needs to save the const buffer for stencil fallback blits. cc: mesa-stable Part-of: (cherry picked from commit 4c647c9e259a6a0fc1499c377a07bfd0ba902079) --- diff --git a/.pick_status.json b/.pick_status.json index a37e553..bd02a99 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1201,7 +1201,7 @@ "description": "zink: only save frag const buffers when used by blit", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/zink/zink_blit.c b/src/gallium/drivers/zink/zink_blit.c index 135378f..59f7fc7 100644 --- a/src/gallium/drivers/zink/zink_blit.c +++ b/src/gallium/drivers/zink/zink_blit.c @@ -355,7 +355,7 @@ zink_blit(struct pipe_context *pctx, util_blitter_clear_depth_stencil(ctx->blitter, dst_view, PIPE_CLEAR_STENCIL, 0, 0, info->dst.box.x, info->dst.box.y, info->dst.box.width, info->dst.box.height); - zink_blit_begin(ctx, ZINK_BLIT_SAVE_FB | ZINK_BLIT_SAVE_FS | ZINK_BLIT_SAVE_TEXTURES); + zink_blit_begin(ctx, ZINK_BLIT_SAVE_FB | ZINK_BLIT_SAVE_FS | ZINK_BLIT_SAVE_TEXTURES | ZINK_BLIT_SAVE_FS_CONST_BUF); util_blitter_stencil_fallback(ctx->blitter, info->dst.resource, info->dst.level, @@ -390,8 +390,10 @@ zink_blit_begin(struct zink_context *ctx, enum zink_blit_flags flags) util_blitter_save_rasterizer(ctx->blitter, ctx->rast_state); util_blitter_save_so_targets(ctx->blitter, ctx->num_so_targets, ctx->so_targets); - if (flags & ZINK_BLIT_SAVE_FS) { + if (flags & ZINK_BLIT_SAVE_FS_CONST_BUF) util_blitter_save_fragment_constant_buffer_slot(ctx->blitter, ctx->ubos[MESA_SHADER_FRAGMENT]); + + if (flags & ZINK_BLIT_SAVE_FS) { util_blitter_save_blend(ctx->blitter, ctx->gfx_pipeline_state.blend_state); util_blitter_save_depth_stencil_alpha(ctx->blitter, ctx->dsa_state); util_blitter_save_stencil_ref(ctx->blitter, &ctx->stencil_ref); diff --git a/src/gallium/drivers/zink/zink_types.h b/src/gallium/drivers/zink/zink_types.h index 93ae9ac..b05ad12 100644 --- a/src/gallium/drivers/zink/zink_types.h +++ b/src/gallium/drivers/zink/zink_types.h @@ -128,6 +128,7 @@ enum zink_blit_flags { ZINK_BLIT_SAVE_FB = 1 << 2, ZINK_BLIT_SAVE_TEXTURES = 1 << 3, ZINK_BLIT_NO_COND_RENDER = 1 << 4, + ZINK_BLIT_SAVE_FS_CONST_BUF = 1 << 5, }; /* descriptor types; also the ordering of the sets