From 56382ec0711d5531da038346d7ce759c2833e13a Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Wed, 17 Nov 2021 15:40:31 +0100 Subject: [PATCH] radeonsi: unreference framebuffer state after use MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit util_copy_framebuffer_state increases refcounts, so we have to decrement them afterwards. Fixes: b1b491cdbba ("radeonsi: add a faster clear path for glClearTexImage") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5631 Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_clear.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_clear.c b/src/gallium/drivers/radeonsi/si_clear.c index 8aa192e..d502eec 100644 --- a/src/gallium/drivers/radeonsi/si_clear.c +++ b/src/gallium/drivers/radeonsi/si_clear.c @@ -1102,6 +1102,9 @@ static bool si_try_normal_clear(struct si_context *sctx, struct pipe_surface *ds ctx->set_framebuffer_state(ctx, &fb); ctx->clear(ctx, buffers, NULL, color, depth, stencil); ctx->set_framebuffer_state(ctx, &saved_fb); + + util_copy_framebuffer_state(&saved_fb, NULL); + return true; } -- 2.7.4