From fca009ad9a94206ff04132fc50a32f2a488b3f73 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: (cherry picked from commit c686c98a795f6a42bb7844cca022ab22c09b2464) --- .pick_status.json | 2 +- src/gallium/auxiliary/cso_cache/cso_context.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 5e9dd4e76d4..957c3e469d3 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -697,7 +697,7 @@ "description": "cso: unbind fb state when unbinding the context", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, 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);