summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Zander <negril.nx+gentoo@gmail.com>2023-12-08 15:36:04 +0100
committerJoonas Niilola <juippis@gentoo.org>2024-02-20 15:12:10 +0200
commit9ec9ce46d4e4a91169d9985976f683d5106de67d (patch)
tree8e869e447d672cda0937b495c6f5f26a642ac045 /media-gfx/blender
parentdev-python/orjson: Fix copyright header (diff)
downloadgentoo-9ec9ce46d4e4a91169d9985976f683d5106de67d.tar.gz
gentoo-9ec9ce46d4e4a91169d9985976f683d5106de67d.tar.bz2
gentoo-9ec9ce46d4e4a91169d9985976f683d5106de67d.zip
media-gfx/openvdb: add 11.0.0
Automatically detects working host compiler for CUDA. Automatically detects host CUDA arch, can be overridden by setting CUDAARCHS env var. Re-enabled ax requiring <=llvm-15. Modified NanoVDB.h so Blender can decern the NanoVDB version and include the correct header. Closes: https://bugs.gentoo.org/664796 Closes: https://bugs.gentoo.org/686824 Closes: https://bugs.gentoo.org/831043 Closes: https://bugs.gentoo.org/833168 Closes: https://bugs.gentoo.org/921246 Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/34564 Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'media-gfx/blender')
-rw-r--r--media-gfx/blender/blender-4.0.1.ebuild1
-rw-r--r--media-gfx/blender/blender-9999.ebuild4
-rw-r--r--media-gfx/blender/files/blender-4.0.1-openvdb-11.patch73
3 files changed, 78 insertions, 0 deletions
diff --git a/media-gfx/blender/blender-4.0.1.ebuild b/media-gfx/blender/blender-4.0.1.ebuild
index 853b1444f8d1..a943d6078e8c 100644
--- a/media-gfx/blender/blender-4.0.1.ebuild
+++ b/media-gfx/blender/blender-4.0.1.ebuild
@@ -143,6 +143,7 @@ BDEPEND="
PATCHES=(
"${FILESDIR}/${PN}-4.0.1-fix-cflags-cleaner.patch" # to be dropped for releases after Dec 8, 2023
+ "${FILESDIR}/${PN}-4.0.1-openvdb-11.patch"
)
blender_check_requirements() {
diff --git a/media-gfx/blender/blender-9999.ebuild b/media-gfx/blender/blender-9999.ebuild
index d1c33bb35bd4..bc907241e946 100644
--- a/media-gfx/blender/blender-9999.ebuild
+++ b/media-gfx/blender/blender-9999.ebuild
@@ -143,6 +143,10 @@ BDEPEND="
)
"
+PATCHES=(
+ "${FILESDIR}/${PN}-4.0.1-openvdb-11.patch"
+)
+
blender_check_requirements() {
[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
diff --git a/media-gfx/blender/files/blender-4.0.1-openvdb-11.patch b/media-gfx/blender/files/blender-4.0.1-openvdb-11.patch
new file mode 100644
index 000000000000..d9455222c6a7
--- /dev/null
+++ b/media-gfx/blender/files/blender-4.0.1-openvdb-11.patch
@@ -0,0 +1,73 @@
+--- a/intern/cycles/scene/image_vdb.cpp 2023-11-23 14:42:38.772685628 +0100
++++ b/intern/cycles/scene/image_vdb.cpp 2023-11-23 15:19:55.475804922 +0100
+@@ -11,7 +11,14 @@
+ # include <openvdb/tools/Dense.h>
+ #endif
+ #ifdef WITH_NANOVDB
+-# include <nanovdb/util/OpenToNanoVDB.h>
++# include <nanovdb/NanoVDB.h>
++# define NANOVDB_VERSION(major, minor, patch) (major << 21 | minor << 10 | patch)
++# if NANOVDB_VERSION(NANOVDB_MAJOR_VERSION_NUMBER, NANOVDB_MINOR_VERSION_NUMBER, NANOVDB_PATCH_VERSION_NUMBER) >= NANOVDB_VERSION(32, 6, 0)
++# include <nanovdb/util/CreateNanoGrid.h>
++# else
++# include <nanovdb/util/OpenToNanoVDB.h>
++# endif
++# undef NANOVDB_VERSION
+ #endif
+
+ CCL_NAMESPACE_BEGIN
+@@ -55,20 +62,35 @@
+ FloatGridType floatgrid(*openvdb::gridConstPtrCast<GridType>(grid));
+ if constexpr (std::is_same_v<FloatGridType, openvdb::FloatGrid>) {
+ if (precision == 0) {
+- nanogrid = nanovdb::openToNanoVDB<nanovdb::HostBuffer,
+- typename FloatGridType::TreeType,
+- nanovdb::FpN>(floatgrid);
++ if constexpr (nanovdb::Version() >= nanovdb::Version(32,6,0)) {
++ nanogrid = nanovdb::createNanoGrid(floatgrid);
++ }
++ else {
++ nanogrid = nanovdb::openToNanoVDB<nanovdb::HostBuffer,
++ typename FloatGridType::TreeType,
++ nanovdb::FpN>(floatgrid);
++ }
+ return true;
+ }
+- else if (precision == 16) {
+- nanogrid = nanovdb::openToNanoVDB<nanovdb::HostBuffer,
+- typename FloatGridType::TreeType,
+- nanovdb::Fp16>(floatgrid);
++ if (precision == 16) {
++ if constexpr (nanovdb::Version() > nanovdb::Version(32,4,0)) {
++ nanogrid = nanovdb::createNanoGrid(floatgrid);
++ }
++ else {
++ nanogrid = nanovdb::openToNanoVDB<nanovdb::HostBuffer,
++ typename FloatGridType::TreeType,
++ nanovdb::Fp16>(floatgrid);
++ }
+ return true;
+ }
+ }
+
+- nanogrid = nanovdb::openToNanoVDB(floatgrid);
++ if constexpr (nanovdb::Version() > nanovdb::Version(32,4,0)) {
++ nanogrid = nanovdb::createNanoGrid(floatgrid);
++ }
++ else {
++ nanogrid = nanovdb::openToNanoVDB(floatgrid);
++ }
+ }
+ catch (const std::exception &e) {
+ VLOG_WARNING << "Error converting OpenVDB to NanoVDB grid: " << e.what();
+--- a/CMakeLists.txt 2023-11-23 15:59:58.715805024 +0100
++++ b/CMakeLists.txt 2023-11-23 16:06:42.352711508 +0100
+@@ -1461,7 +1461,7 @@
+ endif()
+
+ if(WITH_OPENVDB)
+- list(APPEND OPENVDB_DEFINITIONS -DWITH_OPENVDB)
++ list(APPEND OPENVDB_DEFINITIONS -DWITH_OPENVDB -DNANOVDB_USE_OPENVDB)
+
+ if(WITH_OPENVDB_3_ABI_COMPATIBLE)
+ list(APPEND OPENVDB_DEFINITIONS -DOPENVDB_3_ABI_COMPATIBLE)