llvmpipe: handle compute shader launch with 0 threads
[mesa.git] / src / gallium / drivers / llvmpipe / lp_cs_tpool.c
index 6f1b4e2ee5536e55403e94f31b5e31f31d21bcc0..26e82ab1285c52f71c7bfe187ea91b53c81fcc19 100644 (file)
@@ -114,6 +114,15 @@ lp_cs_tpool_queue_task(struct lp_cs_tpool *pool,
 {
    struct lp_cs_tpool_task *task;
 
+   if (pool->num_threads == 0) {
+      struct lp_cs_local_mem lmem;
+
+      memset(&lmem, 0, sizeof(lmem));
+      for (unsigned t = 0; t < num_iters; t++) {
+         work(data, t, &lmem);
+      }
+      return NULL;
+   }
    task = CALLOC_STRUCT(lp_cs_tpool_task);
    if (!task) {
       return NULL;