View | Details | Raw Unified | Return to bug 252868
Collapse All | Expand All

(-)graphics/blender/Makefile (-1 / +1 lines)
Lines 155-161 Link Here
155
SNDFILE_CMAKE_BOOL=		WITH_CODEC_SNDFILE
155
SNDFILE_CMAKE_BOOL=		WITH_CODEC_SNDFILE
156
SNDFILE_LIB_DEPENDS=		libsndfile.so:audio/libsndfile
156
SNDFILE_LIB_DEPENDS=		libsndfile.so:audio/libsndfile
157
TBB_CMAKE_BOOL=			WITH_TBB
157
TBB_CMAKE_BOOL=			WITH_TBB
158
TBB_LIB_DEPENDS=		libtbb.so:devel/tbb
158
TBB_LIB_DEPENDS=		libtbb.so:devel/onetbb
159
TIFF_CMAKE_BOOL=		WITH_IMAGE_TIFF
159
TIFF_CMAKE_BOOL=		WITH_IMAGE_TIFF
160
TIFF_LIB_DEPENDS=		libtiff.so:graphics/tiff
160
TIFF_LIB_DEPENDS=		libtiff.so:graphics/tiff
161
TRACE_CMAKE_BOOL=		WITH_POTRACE
161
TRACE_CMAKE_BOOL=		WITH_POTRACE
(-)graphics/blender/Makefile.options (-2 / +4 lines)
Lines 80-86 Link Here
80
	OPENEXR		\
80
	OPENEXR		\
81
	OPENIMAGEIO	\
81
	OPENIMAGEIO	\
82
	OPENSUBDIV	\
82
	OPENSUBDIV	\
83
	OPENVDB		\
84
	RAYOPTIMIZATION	\
83
	RAYOPTIMIZATION	\
85
	SDL		\
84
	SDL		\
86
	TBB		\
85
	TBB		\
Lines 88-95 Link Here
88
	TRACE		\
87
	TRACE		\
89
	XINPUT		\
88
	XINPUT		\
90
	XF86VMODE
89
	XF86VMODE
90
# off during onetbb transition
91
#	OPENVDB
91
92
92
OPTIONS_DEFAULT_amd64=	CAMERATRACK CYCLESEMBR OPENIMAGEDN
93
# OPENIMAGEDN
94
OPTIONS_DEFAULT_amd64=	CAMERATRACK CYCLESEMBR
93
95
94
ALEMBIC_DESC=		Enable Alembic file support
96
ALEMBIC_DESC=		Enable Alembic file support
95
ALEMBIC_HDF5_DESC=	Enable Alembic hdf5 file support
97
ALEMBIC_HDF5_DESC=	Enable Alembic hdf5 file support
(-)graphics/blender/files/patch-intern_cycles_device_device__cpu.cpp (+38 lines)
Line 0 Link Here
1
--- intern/cycles/device/device_cpu.cpp.orig	2021-01-21 07:59:12 UTC
2
+++ intern/cycles/device/device_cpu.cpp
3
@@ -927,7 +927,7 @@ class CPUDevice : public Device {
4
     SIMD_SET_FLUSH_TO_ZERO;
5
6
     for (int sample = start_sample; sample < end_sample; sample++) {
7
-      if (task.get_cancel() || task_pool.canceled()) {
8
+      if (task.get_cancel() || TaskPool::canceled()) {
9
         if (task.need_finish_queue == false)
10
           break;
11
       }
12
@@ -1220,7 +1220,7 @@ class CPUDevice : public Device {
13
14
   void thread_render(DeviceTask &task)
15
   {
16
-    if (task_pool.canceled()) {
17
+    if (TaskPool::canceled()) {
18
       if (task.need_finish_queue == false)
19
         return;
20
     }
21
@@ -1290,7 +1290,7 @@ class CPUDevice : public Device {
22
23
       task.release_tile(tile);
24
25
-      if (task_pool.canceled()) {
26
+      if (TaskPool::canceled()) {
27
         if (task.need_finish_queue == false)
28
           break;
29
       }
30
@@ -1387,7 +1387,7 @@ class CPUDevice : public Device {
31
                         task.offset,
32
                         sample);
33
34
-      if (task.get_cancel() || task_pool.canceled())
35
+      if (task.get_cancel() || TaskPool::canceled())
36
         break;
37
38
       task.update_progress(NULL);
(-)graphics/blender/files/patch-intern_cycles_util_util__task.cpp (+11 lines)
Line 0 Link Here
1
--- intern/cycles/util/util_task.cpp.orig	2021-01-21 08:00:29 UTC
2
+++ intern/cycles/util/util_task.cpp
3
@@ -62,7 +62,7 @@ void TaskPool::cancel()
4
5
 bool TaskPool::canceled()
6
 {
7
-  return tbb_group.is_canceling();
8
+  return tbb::is_current_task_group_canceling();
9
 }
10
11
 /* Task Scheduler */
(-)graphics/blender/files/patch-intern_cycles_util_util__task.h (+11 lines)
Line 0 Link Here
1
--- intern/cycles/util/util_task.h.orig	2021-01-21 08:01:04 UTC
2
+++ intern/cycles/util/util_task.h
3
@@ -61,7 +61,7 @@ class TaskPool {
4
   void wait_work(Summary *stats = NULL); /* work and wait until all tasks are done */
5
   void cancel(); /* cancel all tasks and wait until they are no longer executing */
6
7
-  bool canceled(); /* for worker threads, test if canceled */
8
+  static bool canceled(); /* For worker threads, test if current task pool canceled. */
9
10
  protected:
11
   tbb::task_group tbb_group;
(-)graphics/blender/files/patch-intern_cycles_util_util__tbb.h (+17 lines)
Line 0 Link Here
1
--- intern/cycles/util/util_tbb.h.orig	2021-01-23 14:10:16 UTC
2
+++ intern/cycles/util/util_tbb.h
3
@@ -36,7 +36,14 @@ using tbb::parallel_for;
4
5
 static inline void parallel_for_cancel()
6
 {
7
+#if TBB_INTERFACE_VERSION_MAJOR >= 12
8
+  tbb::task_group_context *ctx = tbb::task::current_context();
9
+  if (ctx) {
10
+    ctx->cancel_group_execution();
11
+  }
12
+#else
13
   tbb::task::self().cancel_group_execution();
14
+#endif
15
 }
16
17
 CCL_NAMESPACE_END
(-)graphics/blender/files/patch-source_blender_blenlib_BLI__index__range.hh (+26 lines)
Line 0 Link Here
1
--- source/blender/blenlib/BLI_index_range.hh.orig	2021-01-23 14:11:28 UTC
2
+++ source/blender/blenlib/BLI_index_range.hh
3
@@ -58,11 +58,6 @@
4
5
 #include "BLI_utildefines.h"
6
7
-/* Forward declare tbb::blocked_range for conversion operations. */
8
-namespace tbb {
9
-template<typename Value> class blocked_range;
10
-}
11
-
12
 namespace blender {
13
14
 template<typename T> class Span;
15
@@ -84,11 +79,6 @@ class IndexRange {
16
   {
17
     BLI_assert(start >= 0);
18
     BLI_assert(size >= 0);
19
-  }
20
-
21
-  template<typename T>
22
-  IndexRange(const tbb::blocked_range<T> &range) : start_(range.begin()), size_(range.size())
23
-  {
24
   }
25
26
   class Iterator {
(-)graphics/blender/files/patch-source_blender_blenlib_BLI__task.h (+15 lines)
Line 0 Link Here
1
--- source/blender/blenlib/BLI_task.h.orig	2021-01-21 08:02:26 UTC
2
+++ source/blender/blenlib/BLI_task.h
3
@@ -104,8 +104,10 @@ void BLI_task_pool_work_and_wait(TaskPool *pool);
4
 /* cancel all tasks, keep worker threads running */
5
 void BLI_task_pool_cancel(TaskPool *pool);
6
7
-/* for worker threads, test if canceled */
8
-bool BLI_task_pool_canceled(TaskPool *pool);
9
+/* for worker threads, test if current task pool canceled. this function may
10
+ * only be called from worker threads and pool must be the task pool that the
11
+ * thread is currently executing a task from. */
12
+bool BLI_task_pool_current_canceled(TaskPool *pool);
13
14
 /* optional userdata pointer to pass along to run function */
15
 void *BLI_task_pool_user_data(TaskPool *pool);
(-)graphics/blender/files/patch-source_blender_blenlib_intern_task__pool.cc (+41 lines)
Line 0 Link Here
1
--- source/blender/blenlib/intern/task_pool.cc.orig	2020-11-25 19:01:32 UTC
2
+++ source/blender/blenlib/intern/task_pool.cc
3
@@ -131,6 +131,12 @@ class TBBTaskGroup : public tbb::task_group {
4
  public:
5
   TBBTaskGroup(TaskPriority priority)
6
   {
7
+#  if TBB_INTERFACE_VERSION_MAJOR >= 12
8
+    /* TODO: support priorities in TBB 2021, where they are only available as
9
+     * part of task arenas, no longer for task groups. Or remove support for
10
+     * task priorities if they are no longer useful. */
11
+    UNUSED_VARS(priority);
12
+#  else
13
     switch (priority) {
14
       case TASK_PRIORITY_LOW:
15
         my_context.set_priority(tbb::priority_low);
16
@@ -139,6 +145,7 @@ class TBBTaskGroup : public tbb::task_group {
17
         my_context.set_priority(tbb::priority_normal);
18
         break;
19
     }
20
+#endif
21
   }
22
23
   ~TBBTaskGroup()
24
@@ -268,7 +275,7 @@ static bool tbb_task_pool_canceled(TaskPool *pool)
25
 {
26
 #ifdef WITH_TBB
27
   if (pool->use_threads) {
28
-    return pool->tbb_group.is_canceling();
29
+    return tbb::is_current_task_group_canceling();
30
   }
31
 #else
32
   UNUSED_VARS(pool);
33
@@ -520,7 +527,7 @@ void BLI_task_pool_cancel(TaskPool *pool)
34
   }
35
 }
36
37
-bool BLI_task_pool_canceled(TaskPool *pool)
38
+bool BLI_task_pool_current_canceled(TaskPool *pool)
39
 {
40
   switch (pool->type) {
41
     case TASK_POOL_TBB:

Return to bug 252868