[Bf-blender-cvs] [41b3feea85c] master: Fix Cycles build error with latest TBB after recent changes

Brecht Van Lommel noreply at git.blender.org
Mon Apr 18 19:14:49 CEST 2022


Commit: 41b3feea85cd8c323c1c5030f1ab0bc90438df4f
Author: Brecht Van Lommel
Date:   Mon Apr 18 18:30:55 2022 +0200
Branches: master
https://developer.blender.org/rB41b3feea85cd8c323c1c5030f1ab0bc90438df4f

Fix Cycles build error with latest TBB after recent changes

>From changes in 869a46df2980, ref D14454

===================================================================

M	intern/cycles/integrator/path_trace.cpp
M	intern/cycles/util/tbb.h

===================================================================

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()
 {



More information about the Bf-blender-cvs mailing list