diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-01-13 01:40:05 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-01-13 12:40:41 +0300 |
commit | a3deef6fff7c395512cf56a64d6e026f84d95db2 (patch) | |
tree | c2cca7e8582c80b6f349391f6f847529d0744468 /intern/cycles/device | |
parent | eaa4cdaa4230d69b470d229017bad27c03c9ef14 (diff) |
Fix Cycles CPU + GPU render not using CPU after recent changes
In some places the task scheduler was not initialized in time.
Diffstat (limited to 'intern/cycles/device')
-rw-r--r-- | intern/cycles/device/cpu/device_impl.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/device/device.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/intern/cycles/device/cpu/device_impl.cpp b/intern/cycles/device/cpu/device_impl.cpp index 6f3c8b42124..0ca24c241f0 100644 --- a/intern/cycles/device/cpu/device_impl.cpp +++ b/intern/cycles/device/cpu/device_impl.cpp @@ -72,7 +72,7 @@ CPUDevice::CPUDevice(const DeviceInfo &info_, Stats &stats_, Profiler &profiler_ << " CPU kernels."; if (info.cpu_threads == 0) { - info.cpu_threads = TaskScheduler::num_threads(); + info.cpu_threads = TaskScheduler::max_concurrency(); } #ifdef WITH_OSL diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp index d3de6c54a17..14c97affb76 100644 --- a/intern/cycles/device/device.cpp +++ b/intern/cycles/device/device.cpp @@ -334,7 +334,7 @@ DeviceInfo Device::get_multi_device(const vector<DeviceInfo> &subdevices, /* Ensure CPU device does not slow down GPU. */ if (device.type == DEVICE_CPU && subdevices.size() > 1) { if (background) { - int orig_cpu_threads = (threads) ? threads : TaskScheduler::num_threads(); + int orig_cpu_threads = (threads) ? threads : TaskScheduler::max_concurrency(); int cpu_threads = max(orig_cpu_threads - (subdevices.size() - 1), 0); VLOG(1) << "CPU render threads reduced from " << orig_cpu_threads << " to " << cpu_threads |