cso: unbind fb state when unbinding the context
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Mon, 24 Apr 2023 20:23:52 +0000 (16:23 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 3 May 2023 23:45:36 +0000 (23:45 +0000)
this avoids leaking/ballooning references

cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22673>

src/gallium/auxiliary/cso_cache/cso_context.c

index a76296c..d41fa27 100644 (file)
@@ -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);