From c686c98a795f6a42bb7844cca022ab22c09b2464 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 24 Apr 2023 16:23:52 -0400 Subject: [PATCH] cso: unbind fb state when unbinding the context this avoids leaking/ballooning references cc: mesa-stable Reviewed-by: Emma Anholt Part-of: --- src/gallium/auxiliary/cso_cache/cso_context.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index a76296c0325..d41fa27faa1 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -438,6 +438,9 @@ cso_unbind_context(struct cso_context *ctx) if (ctx->has_streamout) ctx->base.pipe->set_stream_output_targets(ctx->base.pipe, 0, NULL, NULL); + + struct pipe_framebuffer_state fb = {0}; + ctx->base.pipe->set_framebuffer_state(ctx->base.pipe, &fb); } util_unreference_framebuffer_state(&ctx->fb);