From dd3f56d7227a60fcc554e7ed030660ca808e0210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tur=C3=A1nszki=20J=C3=A1nos?= Date: Fri, 23 Aug 2024 13:55:19 +0200 Subject: [PATCH] job system fix --- WickedEngine/wiJobSystem.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WickedEngine/wiJobSystem.cpp b/WickedEngine/wiJobSystem.cpp index 49914f657..d2bae7748 100644 --- a/WickedEngine/wiJobSystem.cpp +++ b/WickedEngine/wiJobSystem.cpp @@ -322,9 +322,9 @@ namespace wi::jobsystem job.groupJobEnd = 1; job.sharedmemory_size = 0; - if (res.numThreads <= 1) + if (res.numThreads < 1) { - // If job system is not yet initialized, or only has one threads, job will be executed immediately here instead of thread: + // If job system is not yet initialized, job will be executed immediately here instead of thread: job.execute(); return; } @@ -358,9 +358,9 @@ namespace wi::jobsystem job.groupJobOffset = groupID * groupSize; job.groupJobEnd = std::min(job.groupJobOffset + groupSize, jobCount); - if (res.numThreads <= 1) + if (res.numThreads < 1) { - // If job system is not yet initialized, or only has one threads, job will be executed immediately here instead of thread: + // If job system is not yet initialized, job will be executed immediately here instead of thread: job.execute(); } else