zink: fix refcounting of zink_surface objects
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

this was previously a no-op because the pointers were identical,
leading to an extra unref in check_framebuffer_surface_mutable()

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34077>
This commit is contained in:
Mike Blumenkrantz 2025-03-13 08:46:22 -04:00 committed by Marge Bot
parent 9d359c6d10
commit f5c66e2d4a

View file

@ -364,9 +364,12 @@ zink_create_surface(struct pipe_context *pctx,
csurf->needs_mutable = needs_mutable;
if (needs_mutable) {
pipe_resource_reference(&csurf->base.texture, pres);
struct pipe_resource *ref = NULL;
pipe_resource_reference(&ref, pres);
init_pipe_surface_info(pctx, &csurf->base, templ, pres);
}
/* this may or may not be set previously depending whether templ->texture is set */
csurf->base.texture = pres;
if (templ->nr_samples && !screen->info.have_EXT_multisampled_render_to_single_sampled) {
/* transient fb attachment: not cached */