zink: account for null surface when trying to retain clears on fb bind
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Mon, 13 Feb 2023 19:53:43 +0000 (14:53 -0500)
committerMarge Bot <emma+marge@anholt.net>
Tue, 14 Feb 2023 01:50:14 +0000 (01:50 +0000)
not currently possible but will be soon

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21292>

src/gallium/drivers/zink/zink_context.c

index bb1f730..1ebf560 100644 (file)
@@ -3162,7 +3162,7 @@ zink_set_framebuffer_state(struct pipe_context *pctx,
             struct zink_surface *b = zink_csurface(state->cbufs[i]);
             if (a == b)
                continue;
-            if (memcmp(&a->base.u.tex, &b->base.u.tex, sizeof(b->base.u.tex)) ||
+            if (!a || !b || memcmp(&a->base.u.tex, &b->base.u.tex, sizeof(b->base.u.tex)) ||
                 a->base.texture != b->base.texture)
                flush_clears = true;
             else if (a->base.format != b->base.format)