diff --git a/.pick_status.json b/.pick_status.json index 664686e939d..d50e8a355a4 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1714,7 +1714,7 @@ "description": "crocus: fix refcnt imbalance related to framebuffer", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "f5bde99cbdd208916795dc463663ddd97428ecc1" }, diff --git a/src/gallium/drivers/crocus/crocus_state.c b/src/gallium/drivers/crocus/crocus_state.c index 6bf0f228e60..79509abde20 100644 --- a/src/gallium/drivers/crocus/crocus_state.c +++ b/src/gallium/drivers/crocus/crocus_state.c @@ -8285,6 +8285,8 @@ crocus_upload_compute_state(struct crocus_context *ice, static void crocus_destroy_state(struct crocus_context *ice) { + struct pipe_framebuffer_state *cso = &ice->state.framebuffer; + pipe_resource_reference(&ice->draw.draw_params.res, NULL); pipe_resource_reference(&ice->draw.derived_draw_params.res, NULL); @@ -8294,10 +8296,7 @@ crocus_destroy_state(struct crocus_context *ice) pipe_so_target_reference(&ice->state.so_target[i], NULL); } - for (unsigned i = 0; i < ice->state.framebuffer.nr_cbufs; i++) { - pipe_surface_reference(&ice->state.framebuffer.cbufs[i], NULL); - } - pipe_surface_reference(&ice->state.framebuffer.zsbuf, NULL); + util_unreference_framebuffer_state(cso); for (int stage = 0; stage < MESA_SHADER_STAGES; stage++) { struct crocus_shader_state *shs = &ice->state.shaders[stage];