mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
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@vmware.com>
This commit is contained in:
parent
0141a4cdc0
commit
bde08ce4d7
1 changed files with 9 additions and 0 deletions
|
|
@ -114,6 +114,15 @@ lp_cs_tpool_queue_task(struct lp_cs_tpool *pool,
|
||||||
{
|
{
|
||||||
struct lp_cs_tpool_task *task;
|
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);
|
task = CALLOC_STRUCT(lp_cs_tpool_task);
|
||||||
if (!task) {
|
if (!task) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue