summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-02-12 15:15:36 +0000
committerSam James <sam@gentoo.org>2022-02-12 15:15:36 +0000
commit2943d53a64fc9448e3a6431f8c56bb19f9e04c5b (patch)
treea7f8ddab752aaaaa13e3c0b4e26f097ee694efd8 /media-libs/opensubdiv/files
parentapp-text/kramdown-rfc2629: add 1.5.26 (diff)
downloadgentoo-2943d53a64fc9448e3a6431f8c56bb19f9e04c5b.tar.gz
gentoo-2943d53a64fc9448e3a6431f8c56bb19f9e04c5b.tar.bz2
gentoo-2943d53a64fc9448e3a6431f8c56bb19f9e04c5b.zip
media-libs/opensubdiv: add patch for >= TBB 2021
Bug: https://bugs.gentoo.org/820824 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-libs/opensubdiv/files')
-rw-r--r--media-libs/opensubdiv/files/opensubdiv-3.4.4-tbb-2021.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/media-libs/opensubdiv/files/opensubdiv-3.4.4-tbb-2021.patch b/media-libs/opensubdiv/files/opensubdiv-3.4.4-tbb-2021.patch
new file mode 100644
index 000000000000..bae9c4a9d1f1
--- /dev/null
+++ b/media-libs/opensubdiv/files/opensubdiv-3.4.4-tbb-2021.patch
@@ -0,0 +1,65 @@
+https://github.com/PixarAnimationStudios/OpenSubdiv/pull/1234
+https://bugs.gentoo.org/820824
+
+From 7375c99a4d1337f9b79775fb2c753e7865968642 Mon Sep 17 00:00:00 2001
+From: Artur Sinila <freesoftware@logarithmus.dev>
+Date: Sun, 25 Jul 2021 20:34:48 +0300
+Subject: [PATCH 1/2] Fix typo: schedular -> scheduler
+
+---
+ opensubdiv/osd/tbbEvaluator.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/opensubdiv/osd/tbbEvaluator.h b/opensubdiv/osd/tbbEvaluator.h
+index 6bd365bc5..886a94837 100644
+--- a/opensubdiv/osd/tbbEvaluator.h
++++ b/opensubdiv/osd/tbbEvaluator.h
+@@ -1226,7 +1226,7 @@ class TbbEvaluator {
+ /// \brief synchronize all asynchronous computation invoked on this device.
+ static void Synchronize(void *deviceContext = NULL);
+
+- /// \brief initialize tbb task schedular
++ /// \brief initialize tbb task scheduler
+ /// (optional: client may use tbb::task_scheduler_init)
+ ///
+ /// @param numThreads how many threads
+
+From 9079a517f406afba9ea50657b0a0786ad7a7bdcb Mon Sep 17 00:00:00 2001
+From: Artur Sinila <freesoftware@logarithmus.dev>
+Date: Sun, 25 Jul 2021 20:58:27 +0300
+Subject: [PATCH 2/2] Support oneTBB 2021
+
+---
+ opensubdiv/osd/tbbEvaluator.cpp | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/opensubdiv/osd/tbbEvaluator.cpp b/opensubdiv/osd/tbbEvaluator.cpp
+index c98db9f6d..66c2ed58f 100644
+--- a/opensubdiv/osd/tbbEvaluator.cpp
++++ b/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
++ );
+ }
+ }
+