crocus: fix refcnt imbalance related to framebuffer

Indeed, the hardcoded framebuffer cleanup doesn't handle "resolve".

For instance, this issue is triggered with "piglit/bin/glx-copy-sub-buffer -samples=2 -auto"
while setting GALLIUM_REFCNT_LOG=refcnt.log.

Fixes: f5bde99cbd ("gallium: plumb resolve attachments through from frontends -> pipe_framebuffer_state")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22554>
This commit is contained in:
Patrick Lerda
2023-03-15 13:21:05 +01:00
committed by Marge Bot
parent 3af2ab02f3
commit c39a2d67ea
+3 -4
View File
@@ -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];