Thursday, June 01, 2023

UPDATE: opensubdiv

Here is a diff for opensubdiv to fix building with newer TBB.


Index: Makefile
===================================================================
RCS file: /home/cvs/ports/graphics/opensubdiv/Makefile,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 Makefile
--- Makefile 10 May 2023 08:48:59 -0000 1.5
+++ Makefile 2 Jun 2023 05:09:54 -0000
@@ -5,6 +5,7 @@ GH_ACCOUNT= PixarAnimationStudios
GH_PROJECT= OpenSubdiv
GH_TAGNAME= v${V:S/./_/g}
DISTNAME= ${GH_PROJECT:L}-${V}
+REVISION= 0

SHARED_LIBS += osdCPU 2.0 # 3.4.4
SHARED_LIBS += osdGPU 2.0 # 3.4.4
Index: patches/patch-opensubdiv_osd_tbbEvaluator_cpp
===================================================================
RCS file: patches/patch-opensubdiv_osd_tbbEvaluator_cpp
diff -N patches/patch-opensubdiv_osd_tbbEvaluator_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-opensubdiv_osd_tbbEvaluator_cpp 2 Jun 2023 05:06:55 -0000
@@ -0,0 +1,31 @@
+Support oneTBB 2021
+
+Index: opensubdiv/osd/tbbEvaluator.cpp
+--- opensubdiv/osd/tbbEvaluator.cpp.orig
++++ opensubdiv/osd/tbbEvaluator.cpp
+@@ -25,7 +25,8 @@
+ #include "../osd/tbbEvaluator.h"
+ #include "../osd/tbbKernel.h"
+
+-#include <tbb/task_scheduler_init.h>
++#define TBB_PREVIEW_GLOBAL_CONTROL true
++#include <tbb/global_control.h>
+
+ namespace OpenSubdiv {
+ namespace OPENSUBDIV_VERSION {
+@@ -215,10 +216,11 @@ TbbEvaluator::Synchronize(void *) {
+ /* static */
+ void
+ TbbEvaluator::SetNumThreads(int numThreads) {
+- if (numThreads == -1) {
+- tbb::task_scheduler_init init;
+- } else {
+- tbb::task_scheduler_init init(numThreads);
++ if (numThreads != -1) {
++ tbb::global_control tbb_global_control(
++ tbb::global_control::max_allowed_parallelism,
++ numThreads
++ );
+ }
+ }
+

No comments:

Post a Comment