blender/build_files/build_environment/patches/oidn.diff
Thomas Dinges f7d920a89b Build: Library changes for Blender 5.1
This commit includes new minimum compiler requirements for Blender 5.1 as well as updated and new libraries.

**New compiler requirements**
* Windows x64: Visual Studio 2022 (17.14.14 or newer)
* Windows arm64: Visual Studio 2022 (17.14.23 or newer)
* Linux x64: gcc 14 (when used with our libraries)

**New libraries**
Abseil 20250814.1
ThorVG 1.0.0-pre31
OpenJPH 0.25.2

**Updated libraries**
AOM 3.13.1
Expat 2.7.2
FFI 3.5.2
HIPRT 606b4886efabce918dd0634ef71c06615a47c83b
Imath 3.2.2
ISPC 1.29.1
libheif 1.20.2
MaterialX 1.39.4
MESON 1.9.0
minizip-ng  4.0.10
Numpy 2.3.4
oneAPI Level Zero 1.21.9
OneTBB 2022.3.0
OpenColorIO 2.5.0
OpenEXR 3.4.3
OpenImageDenoise 2.4.1
OpenImageIO 3.1.7
OpenSubDiv 3.7.0
OpenVDB 13.0.0
OpenXR 1.1.53
PIP 25.2
Python 3.13.9
ShaderC 2025.4
Vulkan 1.4.328
webp 1.6.0
Yaml CPP 0.8.0
ZSTD 1.5.7 (z-standard 0.25.0)

**Library changes**
FMT (moved from /extern to libs)
Ceres (updated version in lib, will be removed from /extern in a later commit)
Eigen (updated version in lib, will be removed from /extern in a later commit))

Ref #147201

Co-authored-by: Nikita Sirgienko <nikita.sirgienko@intel.com>
Co-authored-by: Ray Molenkamp <github@lazydodo.com>
Co-authored-by: Sebastian Parborg <sebastian@blender.org>
Co-authored-by: Anthony Roberts <anthony.roberts@linaro.org>
Co-authored-by: Jonas Holzman <jonas@holzman.fr>
Co-authored-by: Bart van der Braak <bart@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/149852
2026-01-22 18:49:15 +01:00

80 lines
3.4 KiB
Diff

diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt
index 27e2ed3..35a8541 100644
--- a/core/CMakeLists.txt
+++ b/core/CMakeLists.txt
@@ -95,6 +95,7 @@ set_target_properties(OpenImageDenoise_core PROPERTIES
OUTPUT_NAME ${OIDN_LIBRARY_NAME}_core
)
target_compile_definitions(OpenImageDenoise_core PRIVATE OIDN_LIBRARY_NAME="${OIDN_LIBRARY_NAME}")
+target_compile_definitions(OpenImageDenoise_core PRIVATE SHARED_POSTFIX=\"$<$<CONFIG:Debug>:$<TARGET_PROPERTY:OpenImageDenoise_core,DEBUG_POSTFIX>>\")
if(OIDN_LIBRARY_VERSIONED)
set_target_properties(OpenImageDenoise_core PROPERTIES VERSION ${PROJECT_VERSION})
diff --git a/core/module.cpp b/core/module.cpp
index 9cd9498..23a5593 100644
--- a/core/module.cpp
+++ b/core/module.cpp
@@ -29,7 +29,7 @@ OIDN_NAMESPACE_BEGIN
return true; // module already loaded
// Get the path of the module to load
- std::string filename = OIDN_LIBRARY_NAME "_" + name;
+ std::string filename = OIDN_LIBRARY_NAME "_" + name + SHARED_POSTFIX;
#if defined(_WIN32)
filename += ".dll";
#else
@@ -39,7 +39,8 @@ OIDN_NAMESPACE_BEGIN
const std::string versionStr = "";
#endif
#if defined(__APPLE__)
- filename = "lib" + filename + versionStr + ".dylib";
+ // BLENDER: version string is stripped on macOS.
+ filename = "lib" + filename + ".dylib";
#else
filename = "lib" + filename + ".so" + versionStr;
#endif
diff --git a/devices/CMakeLists.txt b/devices/CMakeLists.txt
index a0ea112..c6b31f9 100644
--- a/devices/CMakeLists.txt
+++ b/devices/CMakeLists.txt
@@ -60,6 +60,7 @@ if(OIDN_DEVICE_CUDA)
-DOIDN_WARN_AS_ERRORS:BOOL=${OIDN_WARN_AS_ERRORS}
-DOIDN_SANITIZER:STRING=${OIDN_SANITIZER}
-DOIDN_DEVICE_CUDA_API:STRING=${OIDN_DEVICE_CUDA_API}
+ -DPython_EXECUTABLE:STRING=${Python_EXECUTABLE}
)
if(DEFINED CUDAToolkit_ROOT)
list(APPEND _oidn_cuda_cache_args
@@ -170,6 +171,8 @@ if(OIDN_DEVICE_HIP)
-DOIDN_API_NAMESPACE:STRING=${OIDN_API_NAMESPACE}
-DOIDN_WARN_AS_ERRORS:BOOL=${OIDN_WARN_AS_ERRORS}
-DOIDN_SANITIZER:STRING=${OIDN_SANITIZER}
+ -DPython_EXECUTABLE:STRING=${Python_EXECUTABLE}
+ -DCMAKE_DEBUG_POSTFIX:STRING=${CMAKE_DEBUG_POSTFIX}
BUILD_ALWAYS TRUE
DEPENDS
OpenImageDenoise_core
diff --git a/devices/hip/hip_device.cpp b/devices/hip/hip_device.cpp
index 6093afc..2f0e67f 100644
--- a/devices/hip/hip_device.cpp
+++ b/devices/hip/hip_device.cpp
@@ -96,13 +96,19 @@ OIDN_NAMESPACE_BEGIN
HIPArch HIPDevice::getArch(const hipDeviceProp_t& prop)
{
const std::string name = getArchName(prop);
+ // BLENDER: this comment is meant to generate a merge conflict if the code
+ // here changes, so we know that hipSupportsDeviceOIDN should be updated.
if (name == "gfx1030" || name == "gfx1031" || name == "gfx1032" || name == "gfx1034" ||
name == "gfx1035" || name == "gfx1036")
return HIPArch::DL;
+ // BLENDER: this comment is meant to generate a merge conflict if the code
+ // here changes, so we know that hipSupportsDeviceOIDN should be updated.
if (name == "gfx1100" || name == "gfx1101" || name == "gfx1102" || name == "gfx1103" ||
name == "gfx1150" || name == "gfx1151" || name == "gfx1152" ||
name == "gfx1200" || name == "gfx1201")
return HIPArch::WMMA;
+ // BLENDER: this comment is meant to generate a merge conflict if the code
+ // here changes, so we know that hipSupportsDeviceOIDN should be updated.
else
return HIPArch::Unknown;
}