zink: Use an intermediary variable for create_surface

Allows to NULL-check it afterwards.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28025>
This commit is contained in:
Corentin Noël 2024-03-08 15:35:37 +01:00 committed by Marge Bot
parent faaa65a1a3
commit 55cdde758c

View file

@ -355,7 +355,8 @@ zink_create_surface(struct pipe_context *pctx,
if (!transient)
return NULL;
ivci.image = transient->obj->image;
csurf->transient = wrap_surface(pctx, (struct pipe_surface*)create_surface(pctx, &transient->base.b, templ, &ivci, true));
struct zink_surface *tsurf = create_surface(pctx, &transient->base.b, templ, &ivci, true);
csurf->transient = wrap_surface(pctx, &tsurf->base);
if (!csurf->transient) {
pipe_resource_reference((struct pipe_resource**)&transient, NULL);
pipe_surface_release(pctx, &psurf);