Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2022-04-18 19:30:55 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-04-18 19:49:35 +0300
commit41b3feea85cd8c323c1c5030f1ab0bc90438df4f (patch)
tree06564a8956b5b01f343e57c6bec44ba68dc41b56
parentccd2e89d37fb4887045969c1a50a66ca024c8c11 (diff)
Fix Cycles build error with latest TBB after recent changes
From changes in 869a46df2980, ref D14454
-rw-r--r--intern/cycles/integrator/path_trace.cpp3
-rw-r--r--intern/cycles/util/tbb.h11
2 files changed, 12 insertions, 2 deletions
diff --git a/intern/cycles/integrator/path_trace.cpp b/intern/cycles/integrator/path_trace.cpp
index f1e70b7f28f..6fddbf56edc 100644
--- a/intern/cycles/integrator/path_trace.cpp
+++ b/intern/cycles/integrator/path_trace.cpp
@@ -355,8 +355,7 @@ void PathTrace::path_trace(RenderWork &render_work)
const int num_works = path_trace_works_.size();
- tbb::task_group_context *tbb_ctx = tbb::task::self().group();
- tbb_ctx->capture_fp_settings();
+ thread_capture_fp_settings();
tbb::parallel_for(0, num_works, [&](int i) {
const double work_start_time = time_dt();
diff --git a/intern/cycles/util/tbb.h b/intern/cycles/util/tbb.h
index 7105ddda0f8..948bf2b3e0e 100644
--- a/intern/cycles/util/tbb.h
+++ b/intern/cycles/util/tbb.h
@@ -25,6 +25,17 @@ CCL_NAMESPACE_BEGIN
using tbb::blocked_range;
using tbb::enumerable_thread_specific;
using tbb::parallel_for;
+using tbb::parallel_for_each;
+
+static inline void thread_capture_fp_settings()
+{
+#if TBB_INTERFACE_VERSION_MAJOR >= 12
+ tbb::task_group_context *ctx = tbb::task::current_context();
+#else
+ tbb::task_group_context *ctx = tbb::task::self().group();
+#endif
+ ctx->capture_fp_settings();
+}
static inline void parallel_for_cancel()
{