zink: fail if set failed to create
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 8 Dec 2020 11:45:23 +0000 (12:45 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 10 Dec 2020 09:45:28 +0000 (09:45 +0000)
Fixes: a03d17ede77 ("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>

src/gallium/drivers/zink/zink_context.c

index 69b4846478f2467ba3617486305aeb218cdad4fe..92974adcc91f8f5b45dd8b6a4165d7d0735415e7 100644 (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);