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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21134>
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -135,6 +135,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
|
||||
|
||||
Reference in New Issue
Block a user