freedreno: Fix u_blitter constant-buffer leak

We didn't see this before without threaded_context because we (normally)
wouldn't upload cb0 (the slot u_blitter uses).  But with cb0 getting
uploaded we could hit a leak due to constant state only being restored
in the fd_blitter_clear() path.  Move cb0 save to the one path that uses
it.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9323>
This commit is contained in:
Rob Clark 2021-03-04 11:24:49 -08:00 committed by Marge Bot
parent 9425b1343e
commit bcf4562528

View file

@ -82,8 +82,6 @@ fd_blitter_pipe_begin(struct fd_context *ctx, bool render_cond, bool discard)
{
fd_fence_ref(&ctx->last_fence, NULL);
util_blitter_save_fragment_constant_buffer_slot(ctx->blitter,
ctx->constbuf[PIPE_SHADER_FRAGMENT].cb);
util_blitter_save_vertex_buffer_slot(ctx->blitter, ctx->vtx.vertexbuf.vb);
util_blitter_save_vertex_elements(ctx->blitter, ctx->vtx.vtx);
util_blitter_save_vertex_shader(ctx->blitter, ctx->prog.vs);
@ -184,6 +182,9 @@ fd_blitter_clear(struct pipe_context *pctx, unsigned buffers,
*/
fd_blitter_pipe_begin(ctx, false, false);
util_blitter_save_fragment_constant_buffer_slot(ctx->blitter,
ctx->constbuf[PIPE_SHADER_FRAGMENT].cb);
util_blitter_common_clear_setup(blitter, pfb->width, pfb->height,
buffers, NULL, NULL);