Mesa (master): llvmpipe: handle compute shader launch with 0 threads
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Oct 21 22:51:34 UTC 2019
Module: Mesa
Branch: master
Commit: bde08ce4d7bf2e59054ea1c522e82037c9dd147b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bde08ce4d7bf2e59054ea1c522e82037c9dd147b
Author: Dave Airlie <airlied at redhat.com>
Date: Wed Oct 16 13:33:36 2019 +1000
llvmpipe: handle compute shader launch with 0 threads
If you set LP_NUM_THREADS=0 compute shaders would hang,
just execute the workloads in sequence if we have no threads
in the pool.
Fixes: 1b24e3ba75 ("llvmpipe: add compute threadpool + mutex")
Reviewed-by: Roland Scheidegger <sroland at vmware.com>
---
src/gallium/drivers/llvmpipe/lp_cs_tpool.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/gallium/drivers/llvmpipe/lp_cs_tpool.c b/src/gallium/drivers/llvmpipe/lp_cs_tpool.c
index 6f1b4e2ee55..26e82ab1285 100644
--- a/src/gallium/drivers/llvmpipe/lp_cs_tpool.c
+++ b/src/gallium/drivers/llvmpipe/lp_cs_tpool.c
@@ -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;
More information about the mesa-commit
mailing list