zink: fail if set failed to create

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>
(cherry picked from commit 8a30ac49ac72275d4b123807fceb175658203f95)
diff --git a/.pick_status.json b/.pick_status.json
index 4fdb5c6..c3b5419 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -175,7 +175,7 @@
         "description": "zink: fail if set failed to create",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "a03d17ede778610f2c66099d0d5342cf09ef12a2"
     },
diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c
index ab38845..2f01fa7 100644
--- a/src/gallium/drivers/zink/zink_context.c
+++ b/src/gallium/drivers/zink/zink_context.c
@@ -1304,7 +1304,8 @@
                                                   _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);