zink: fail if set failed to create

Fixes: a03d17ede7 ("zink: refcount zink_gfx_program objects")

Acked-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7985>
This commit is contained in:
Erik Faye-Lund 2020-12-08 12:45:23 +01:00 committed by Marge Bot
parent 7c85b1d2f0
commit 8a30ac49ac

View file

@ -1350,7 +1350,8 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
_mesa_hash_pointer,
_mesa_key_pointer_equal);
if (!ctx->batches[i].resources || !ctx->batches[i].sampler_views)
if (!ctx->batches[i].resources || !ctx->batches[i].sampler_views ||
!ctx->batches[i].programs)
goto fail;
util_dynarray_init(&ctx->batches[i].zombie_samplers, NULL);