Fix #106235: Use consistent order for multi-input socket links #106320
@ -15,6 +15,7 @@ body:
|
||||
* Test [daily builds](https://builder.blender.org/) to verify if the issue is already fixed.
|
||||
* Test [previous versions](https://download.blender.org/release/) to find an older working version.
|
||||
* For feature requests, feedback, questions or build issues, see [communication channels](https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests).
|
||||
* Security vulnerabilities should be [reported privately](https://wiki.blender.org/wiki/Process/Vulnerability_Reports).
|
||||
* If there are multiple bugs, make multiple bug reports.
|
||||
|
||||
- type: textarea
|
||||
|
@ -164,7 +164,7 @@ get_blender_version()
|
||||
# Declare Options
|
||||
|
||||
# Blender internal features
|
||||
option(WITH_BLENDER "Build blender (disable to build only the blender player)" ON)
|
||||
option(WITH_BLENDER "Build blender (disable to build only Cycles stand-alone)." ON)
|
||||
mark_as_advanced(WITH_BLENDER)
|
||||
|
||||
if(WIN32)
|
||||
@ -333,10 +333,7 @@ option(WITH_MOD_OCEANSIM "Enable Ocean Modifier" ON)
|
||||
# Image format support
|
||||
option(WITH_IMAGE_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON)
|
||||
option(WITH_IMAGE_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org)" ON)
|
||||
option(WITH_IMAGE_TIFF "Enable LibTIFF Support" ON)
|
||||
option(WITH_IMAGE_DDS "Enable DDS Image Support" ON)
|
||||
option(WITH_IMAGE_CINEON "Enable CINEON and DPX Image Support" ON)
|
||||
option(WITH_IMAGE_HDR "Enable HDR Image Support" ON)
|
||||
option(WITH_IMAGE_WEBP "Enable WebP Image Support" ON)
|
||||
|
||||
# Audio/Video format support
|
||||
@ -648,15 +645,15 @@ if(WIN32)
|
||||
endif()
|
||||
|
||||
# Compiler tool-chain.
|
||||
if(UNIX AND NOT APPLE)
|
||||
if(UNIX)
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
option(WITH_LINKER_GOLD "Use ld.gold linker which is usually faster than ld.bfd" ON)
|
||||
mark_as_advanced(WITH_LINKER_GOLD)
|
||||
option(WITH_LINKER_LLD "Use ld.lld linker which is usually faster than ld.gold" OFF)
|
||||
mark_as_advanced(WITH_LINKER_LLD)
|
||||
endif()
|
||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
option(WITH_LINKER_MOLD "Use ld.mold linker which is usually faster than ld.gold & ld.lld." OFF)
|
||||
option(WITH_LINKER_LLD "Use ld.lld linker which is usually faster than ld.gold" OFF)
|
||||
mark_as_advanced(WITH_LINKER_LLD)
|
||||
option(WITH_LINKER_MOLD "Use ld.mold linker which is usually faster than ld.gold & ld.lld. Needs \"sold\" subscription on macOS." OFF)
|
||||
mark_as_advanced(WITH_LINKER_MOLD)
|
||||
endif()
|
||||
endif()
|
||||
@ -693,8 +690,10 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
else()
|
||||
string(APPEND _asan_defaults " -fsanitize=object-size")
|
||||
endif()
|
||||
else()
|
||||
elseif(CMAKE_COMPILER_IS_GNUCC)
|
||||
string(APPEND _asan_defaults " -fsanitize=leak -fsanitize=object-size")
|
||||
else()
|
||||
string(APPEND _asan_defaults " -fsanitize=leak")
|
||||
endif()
|
||||
|
||||
set(COMPILER_ASAN_CFLAGS "${_asan_defaults}" CACHE STRING "C flags for address sanitizer")
|
||||
@ -711,6 +710,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/7.0.0/lib/windows
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\LLVM\\LLVM;]/lib/clang/6.0.0/lib/windows
|
||||
)
|
||||
mark_as_advanced(COMPILER_ASAN_LIBRARY)
|
||||
elseif(APPLE)
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER}
|
||||
-print-file-name=lib
|
||||
@ -725,13 +725,14 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
"${CLANG_LIB_DIR}/darwin/"
|
||||
)
|
||||
unset(CLANG_LIB_DIR)
|
||||
else()
|
||||
mark_as_advanced(COMPILER_ASAN_LIBRARY)
|
||||
elseif(CMAKE_COMPILER_IS_GNUCC)
|
||||
find_library(
|
||||
COMPILER_ASAN_LIBRARY asan ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}
|
||||
)
|
||||
mark_as_advanced(COMPILER_ASAN_LIBRARY)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(COMPILER_ASAN_LIBRARY)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -886,11 +887,11 @@ set_and_warn_dependency(WITH_TBB WITH_MOD_FLUID OFF)
|
||||
# NanoVDB requires OpenVDB to convert the data structure
|
||||
set_and_warn_dependency(WITH_OPENVDB WITH_NANOVDB OFF)
|
||||
|
||||
# OpenVDB and OpenColorIO uses 'half' type from OpenEXR
|
||||
# OpenVDB, Alembic and Vulkan, OSL uses 'half' or 'imath' from OpenEXR
|
||||
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_OPENVDB OFF)
|
||||
|
||||
# Haru needs `TIFFFaxBlackCodes` & `TIFFFaxWhiteCodes` symbols from TIFF.
|
||||
set_and_warn_dependency(WITH_IMAGE_TIFF WITH_HARU OFF)
|
||||
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_ALEMBIC OFF)
|
||||
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_VULKAN_BACKEND OFF)
|
||||
set_and_warn_dependency(WITH_IMAGE_OPENEXR WITH_CYCLES_OSL OFF)
|
||||
|
||||
# auto enable openimageio for cycles
|
||||
if(WITH_CYCLES)
|
||||
@ -1934,11 +1935,8 @@ if(FIRST_RUN)
|
||||
|
||||
info_cfg_text("Image Formats:")
|
||||
info_cfg_option(WITH_IMAGE_CINEON)
|
||||
info_cfg_option(WITH_IMAGE_DDS)
|
||||
info_cfg_option(WITH_IMAGE_HDR)
|
||||
info_cfg_option(WITH_IMAGE_OPENEXR)
|
||||
info_cfg_option(WITH_IMAGE_OPENJPEG)
|
||||
info_cfg_option(WITH_IMAGE_TIFF)
|
||||
|
||||
info_cfg_text("Audio:")
|
||||
info_cfg_option(WITH_CODEC_AVI)
|
||||
|
@ -6,15 +6,24 @@
|
||||
set(EMBREE_EXTRA_ARGS
|
||||
-DEMBREE_ISPC_SUPPORT=OFF
|
||||
-DEMBREE_TUTORIALS=OFF
|
||||
-DEMBREE_STATIC_LIB=ON
|
||||
-DEMBREE_STATIC_LIB=OFF
|
||||
-DEMBREE_RAY_MASK=ON
|
||||
-DEMBREE_FILTER_FUNCTION=ON
|
||||
-DEMBREE_BACKFACE_CULLING=OFF
|
||||
-DEMBREE_BACKFACE_CULLING_CURVES=ON
|
||||
-DEMBREE_BACKFACE_CULLING_SPHERES=ON
|
||||
-DEMBREE_TASKING_SYSTEM=TBB
|
||||
-DEMBREE_TBB_ROOT=${LIBDIR}/tbb
|
||||
-DTBB_ROOT=${LIBDIR}/tbb
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
set(EMBREE_EXTRA_ARGS
|
||||
${EMBREE_EXTRA_ARGS}
|
||||
-DCMAKE_DEBUG_POSTFIX=_d
|
||||
)
|
||||
endif()
|
||||
|
||||
if(NOT BLENDER_PLATFORM_ARM)
|
||||
set(EMBREE_EXTRA_ARGS
|
||||
${EMBREE_EXTRA_ARGS}
|
||||
@ -45,25 +54,19 @@ add_dependencies(
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
|
||||
if(BUILD_MODE STREQUAL Release)
|
||||
ExternalProject_Add_Step(external_embree after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/embree ${HARVEST_TARGET}/embree
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/embree/include ${HARVEST_TARGET}/embree/include
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/embree/lib ${HARVEST_TARGET}/embree/lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/embree/share ${HARVEST_TARGET}/embree/share
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/bin/embree4.dll ${HARVEST_TARGET}/embree/bin/embree4.dll
|
||||
DEPENDEES install
|
||||
)
|
||||
else()
|
||||
ExternalProject_Add_Step(external_embree after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree3.lib ${HARVEST_TARGET}/embree/lib/embree3_d.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree_avx.lib ${HARVEST_TARGET}/embree/lib/embree_avx_d.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree_avx2.lib ${HARVEST_TARGET}/embree/lib/embree_avx2_d.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree_sse42.lib ${HARVEST_TARGET}/embree/lib/embree_sse42_d.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/lexers.lib ${HARVEST_TARGET}/embree/lib/lexers_d.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/math.lib ${HARVEST_TARGET}/embree/lib/math_d.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/simd.lib ${HARVEST_TARGET}/embree/lib/simd_d.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/sys.lib ${HARVEST_TARGET}/embree/lib/sys_d.lib
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/tasking.lib ${HARVEST_TARGET}/embree/lib/tasking_d.lib
|
||||
DEPENDEES install
|
||||
)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add_Step(external_embree after_install
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/bin/embree4_d.dll ${HARVEST_TARGET}/embree/bin/embree4_d.dll
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/embree/lib/embree4_d.lib ${HARVEST_TARGET}/embree/lib/embree4_d.lib
|
||||
DEPENDEES install
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -218,6 +218,7 @@ else()
|
||||
harvest(openimagedenoise/lib openimagedenoise/lib "*.a")
|
||||
harvest(embree/include embree/include "*.h")
|
||||
harvest(embree/lib embree/lib "*.a")
|
||||
harvest(embree/lib embree/lib "*${SHAREDLIBEXT}*")
|
||||
harvest(openpgl/include openpgl/include "*.h")
|
||||
harvest(openpgl/lib openpgl/lib "*.a")
|
||||
harvest(openpgl/lib/cmake/openpgl-${OPENPGL_SHORT_VERSION} openpgl/lib/cmake/openpgl "*.cmake")
|
||||
|
@ -478,9 +478,9 @@ set(SQLITE_HASH_TYPE SHA1)
|
||||
set(SQLITE_FILE sqlite-autoconf-${SQLLITE_LONG_VERSION}.tar.gz)
|
||||
set(SQLITE_CPE "cpe:2.3:a:sqlite:sqlite:${SQLITE_VERSION}:*:*:*:*:*:*:*")
|
||||
|
||||
set(EMBREE_VERSION 3.13.4)
|
||||
set(EMBREE_VERSION 4.0.1)
|
||||
set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip)
|
||||
set(EMBREE_HASH 52d0be294d6c88ba7a6c9e046796e7be)
|
||||
set(EMBREE_HASH dd26617719a587e126b341d1b32f7fd0)
|
||||
set(EMBREE_HASH_TYPE MD5)
|
||||
set(EMBREE_FILE embree-v${EMBREE_VERSION}.zip)
|
||||
|
||||
@ -534,10 +534,10 @@ set(WL_PROTOCOLS_URI https://gitlab.freedesktop.org/wayland/wayland-protocols/-/
|
||||
set(WL_PROTOCOLS_HASH a28ff59a56e2ebb746048b6ef8d931d6)
|
||||
set(WL_PROTOCOLS_HASH_TYPE MD5)
|
||||
|
||||
set(WAYLAND_VERSION 1.21.0)
|
||||
set(WAYLAND_VERSION 1.22.0)
|
||||
set(WAYLAND_FILE wayland-${WAYLAND_VERSION}.tar.xz)
|
||||
set(WAYLAND_URI https://gitlab.freedesktop.org/wayland/wayland/-/releases/1.21.0/downloads/wayland-${WAYLAND_VERSION}.tar.xz)
|
||||
set(WAYLAND_HASH f2653a2293bcd882d756c6a83d278903)
|
||||
set(WAYLAND_URI https://gitlab.freedesktop.org/wayland/wayland/-/releases/${WAYLAND_VERSION}/downloads/wayland-${WAYLAND_VERSION}.tar.xz)
|
||||
set(WAYLAND_HASH 7410ab549e3928fce9381455b17b0803)
|
||||
set(WAYLAND_HASH_TYPE MD5)
|
||||
|
||||
set(WAYLAND_LIBDECOR_VERSION 0.1.0)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,19 +1,8 @@
|
||||
diff -Naur org/kernels/rtcore_config.h.in embree-3.13.4/kernels/rtcore_config.h.in
|
||||
--- org/kernels/rtcore_config.h.in 2022-06-14 22:13:52 -0600
|
||||
+++ embree-3.13.4/kernels/rtcore_config.h.in 2022-06-24 15:20:12 -0600
|
||||
@@ -14,6 +14,7 @@
|
||||
#cmakedefine01 EMBREE_MIN_WIDTH
|
||||
#define RTC_MIN_WIDTH EMBREE_MIN_WIDTH
|
||||
|
||||
+#cmakedefine EMBREE_STATIC_LIB
|
||||
#cmakedefine EMBREE_API_NAMESPACE
|
||||
|
||||
#if defined(EMBREE_API_NAMESPACE)
|
||||
diff --git a/kernels/CMakeLists.txt b/kernels/CMakeLists.txt
|
||||
index 7c2f43d..106b1d5 100644
|
||||
--- a/kernels/CMakeLists.txt
|
||||
+++ b/kernels/CMakeLists.txt
|
||||
@@ -201,6 +201,12 @@ embree_files(EMBREE_LIBRARY_FILES_AVX512 ${AVX512})
|
||||
@@ -208,6 +208,12 @@ embree_files(EMBREE_LIBRARY_FILES_AVX512 ${AVX512})
|
||||
#message("AVX2: ${EMBREE_LIBRARY_FILES_AVX2}")
|
||||
#message("AVX512: ${EMBREE_LIBRARY_FILES_AVX512}")
|
||||
|
||||
@ -26,7 +15,7 @@ index 7c2f43d..106b1d5 100644
|
||||
# replaces all .cpp files with a dummy file that includes that .cpp file
|
||||
# this is to work around an ICC name mangling issue related to lambda functions under windows
|
||||
MACRO (CreateISADummyFiles list isa)
|
||||
@@ -277,7 +283,7 @@ IF (EMBREE_ISA_AVX AND EMBREE_LIBRARY_FILES_AVX)
|
||||
@@ -311,7 +317,7 @@ IF (EMBREE_ISA_AVX AND EMBREE_LIBRARY_FILES_AVX)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
@ -35,3 +24,128 @@ index 7c2f43d..106b1d5 100644
|
||||
DISABLE_STACK_PROTECTOR_FOR_INTERSECTORS(${EMBREE_LIBRARY_FILES_AVX2})
|
||||
ADD_LIBRARY(embree_avx2 STATIC ${EMBREE_LIBRARY_FILES_AVX2})
|
||||
TARGET_LINK_LIBRARIES(embree_avx2 PRIVATE tasking)
|
||||
diff --git a/include/embree4/rtcore_device.h b/include/embree4/rtcore_device.h
|
||||
index 45bf95583..62ee7787d 100644
|
||||
--- a/include/embree4/rtcore_device.h
|
||||
+++ b/include/embree4/rtcore_device.h
|
||||
@@ -55,6 +55,7 @@ enum RTCDeviceProperty
|
||||
RTC_DEVICE_PROPERTY_FILTER_FUNCTION_SUPPORTED = 66,
|
||||
RTC_DEVICE_PROPERTY_IGNORE_INVALID_RAYS_ENABLED = 67,
|
||||
RTC_DEVICE_PROPERTY_COMPACT_POLYS_ENABLED = 68,
|
||||
+ RTC_DEVICE_PROPERTY_BACKFACE_CULLING_SPHERES_ENABLED = 69,
|
||||
|
||||
RTC_DEVICE_PROPERTY_TRIANGLE_GEOMETRY_SUPPORTED = 96,
|
||||
RTC_DEVICE_PROPERTY_QUAD_GEOMETRY_SUPPORTED = 97,
|
||||
diff --git a/kernels/common/device.cpp b/kernels/common/device.cpp
|
||||
index 3ffac7e37..215ccc961 100644
|
||||
--- a/kernels/common/device.cpp
|
||||
+++ b/kernels/common/device.cpp
|
||||
@@ -170,6 +170,9 @@ namespace embree
|
||||
#if defined (EMBREE_BACKFACE_CULLING_CURVES)
|
||||
v += "backfacecullingcurves ";
|
||||
#endif
|
||||
+#if defined (EMBREE_BACKFACE_CULLING_SPHERES)
|
||||
+ v += "backfacecullingspheres ";
|
||||
+#endif
|
||||
#if defined(EMBREE_FILTER_FUNCTION)
|
||||
v += "intersection_filter ";
|
||||
#endif
|
||||
@@ -477,6 +480,12 @@ namespace embree
|
||||
case RTC_DEVICE_PROPERTY_BACKFACE_CULLING_CURVES_ENABLED: return 0;
|
||||
#endif
|
||||
|
||||
+#if defined(EMBREE_BACKFACE_CULLING_SPHERES)
|
||||
+ case RTC_DEVICE_PROPERTY_BACKFACE_CULLING_SPHERES_ENABLED: return 1;
|
||||
+#else
|
||||
+ case RTC_DEVICE_PROPERTY_BACKFACE_CULLING_SPHERES_ENABLED: return 0;
|
||||
+#endif
|
||||
+
|
||||
#if defined(EMBREE_COMPACT_POLYS)
|
||||
case RTC_DEVICE_PROPERTY_COMPACT_POLYS_ENABLED: return 1;
|
||||
#else
|
||||
diff --git a/kernels/config.h.in b/kernels/config.h.in
|
||||
index f02c90360..ba9acde56 100644
|
||||
--- a/kernels/config.h.in
|
||||
+++ b/kernels/config.h.in
|
||||
@@ -5,6 +5,7 @@
|
||||
#cmakedefine EMBREE_STAT_COUNTERS
|
||||
#cmakedefine EMBREE_BACKFACE_CULLING
|
||||
#cmakedefine EMBREE_BACKFACE_CULLING_CURVES
|
||||
+#cmakedefine EMBREE_BACKFACE_CULLING_SPHERES
|
||||
#cmakedefine EMBREE_FILTER_FUNCTION
|
||||
#cmakedefine EMBREE_IGNORE_INVALID_RAYS
|
||||
#cmakedefine EMBREE_GEOMETRY_TRIANGLE
|
||||
diff --git a/kernels/geometry/sphere_intersector.h b/kernels/geometry/sphere_intersector.h
|
||||
index 074f910a2..30f490818 100644
|
||||
--- a/kernels/geometry/sphere_intersector.h
|
||||
+++ b/kernels/geometry/sphere_intersector.h
|
||||
@@ -106,8 +106,13 @@ namespace embree
|
||||
const vbool<M> valid_front = valid & (ray.tnear() <= t_front) & (t_front <= ray.tfar);
|
||||
const vbool<M> valid_back = valid & (ray.tnear() <= t_back ) & (t_back <= ray.tfar);
|
||||
|
||||
+#if defined (EMBREE_BACKFACE_CULLING_SPHERES)
|
||||
+ /* check if there is a first hit */
|
||||
+ const vbool<M> valid_first = valid_front;
|
||||
+#else
|
||||
/* check if there is a first hit */
|
||||
const vbool<M> valid_first = valid_front | valid_back;
|
||||
+#endif
|
||||
if (unlikely(none(valid_first)))
|
||||
return false;
|
||||
|
||||
@@ -120,7 +125,8 @@ namespace embree
|
||||
|
||||
/* invoke intersection filter for first hit */
|
||||
const bool is_hit_first = epilog(valid_first, hit);
|
||||
-
|
||||
+
|
||||
+#if !defined (EMBREE_BACKFACE_CULLING_SPHERES)
|
||||
/* check for possible second hits before potentially accepted hit */
|
||||
const vfloat<M> t_second = t_back;
|
||||
const vbool<M> valid_second = valid_front & valid_back & (t_second <= ray.tfar);
|
||||
@@ -131,7 +137,9 @@ namespace embree
|
||||
const Vec3vf<M> Ng_second = td_back * ray_dir - perp;
|
||||
hit = SphereIntersectorHitM<M> (t_second, Ng_second);
|
||||
const bool is_hit_second = epilog(valid_second, hit);
|
||||
-
|
||||
+#else
|
||||
+ constexpr bool is_hit_second = false;
|
||||
+#endif
|
||||
return is_hit_first | is_hit_second;
|
||||
}
|
||||
|
||||
@@ -186,8 +194,13 @@ namespace embree
|
||||
const vbool<M> valid_front = valid & (ray.tnear()[k] <= t_front) & (t_front <= ray.tfar[k]);
|
||||
const vbool<M> valid_back = valid & (ray.tnear()[k] <= t_back ) & (t_back <= ray.tfar[k]);
|
||||
|
||||
+#if defined (EMBREE_BACKFACE_CULLING_SPHERES)
|
||||
+ /* check if there is a first hit */
|
||||
+ const vbool<M> valid_first = valid_front;
|
||||
+#else
|
||||
/* check if there is a first hit */
|
||||
const vbool<M> valid_first = valid_front | valid_back;
|
||||
+#endif
|
||||
if (unlikely(none(valid_first)))
|
||||
return false;
|
||||
|
||||
@@ -200,7 +213,8 @@ namespace embree
|
||||
|
||||
/* invoke intersection filter for first hit */
|
||||
const bool is_hit_first = epilog(valid_first, hit);
|
||||
-
|
||||
+
|
||||
+#if !defined (EMBREE_BACKFACE_CULLING_SPHERES)
|
||||
/* check for possible second hits before potentially accepted hit */
|
||||
const vfloat<M> t_second = t_back;
|
||||
const vbool<M> valid_second = valid_front & valid_back & (t_second <= ray.tfar[k]);
|
||||
@@ -211,7 +225,9 @@ namespace embree
|
||||
const Vec3vf<M> Ng_second = td_back * ray_dir - perp;
|
||||
hit = SphereIntersectorHitM<M> (t_second, Ng_second);
|
||||
const bool is_hit_second = epilog(valid_second, hit);
|
||||
-
|
||||
+#else
|
||||
+ constexpr bool is_hit_second = false;
|
||||
+#endif
|
||||
return is_hit_first | is_hit_second;
|
||||
}
|
||||
};
|
||||
|
@ -23,6 +23,7 @@ SET(_embree_SEARCH_DIRS
|
||||
|
||||
FIND_PATH(EMBREE_INCLUDE_DIR
|
||||
NAMES
|
||||
embree4/rtcore.h
|
||||
embree3/rtcore.h
|
||||
HINTS
|
||||
${_embree_SEARCH_DIRS}
|
||||
@ -30,28 +31,67 @@ FIND_PATH(EMBREE_INCLUDE_DIR
|
||||
include
|
||||
)
|
||||
|
||||
IF(NOT (("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") OR (APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))))
|
||||
SET(_embree_SIMD_COMPONENTS
|
||||
embree_sse42
|
||||
embree_avx
|
||||
embree_avx2
|
||||
)
|
||||
IF(EXISTS ${EMBREE_INCLUDE_DIR}/embree4/rtcore_config.h)
|
||||
SET(EMBREE_MAJOR_VERSION 4)
|
||||
ELSE()
|
||||
SET(EMBREE_MAJOR_VERSION 3)
|
||||
ENDIF()
|
||||
|
||||
SET(_embree_FIND_COMPONENTS
|
||||
embree3
|
||||
${_embree_SIMD_COMPONENTS}
|
||||
lexers
|
||||
math
|
||||
simd
|
||||
sys
|
||||
tasking
|
||||
)
|
||||
IF(EMBREE_INCLUDE_DIR)
|
||||
FILE(READ ${EMBREE_INCLUDE_DIR}/embree${EMBREE_MAJOR_VERSION}/rtcore_config.h _embree_config_header)
|
||||
IF(_embree_config_header MATCHES "#define EMBREE_STATIC_LIB")
|
||||
SET(EMBREE_STATIC_LIB TRUE)
|
||||
ELSE()
|
||||
SET(EMBREE_STATIC_LIB FALSE)
|
||||
ENDIF()
|
||||
IF(_embree_config_header MATCHES "#define EMBREE_SYCL_SUPPORT")
|
||||
SET(EMBREE_SYCL_SUPPORT TRUE)
|
||||
ELSE()
|
||||
SET(EMBREE_SYCL_SUPPORT FALSE)
|
||||
ENDIF()
|
||||
UNSET(_embree_config_header)
|
||||
ENDIF()
|
||||
|
||||
IF(EMBREE_STATIC_LIB)
|
||||
IF(NOT (("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") OR (APPLE AND ("${CMAKE_OSX_ARCHITECTURES}" STREQUAL "arm64"))))
|
||||
SET(_embree_SIMD_COMPONENTS
|
||||
embree_sse42
|
||||
embree_avx
|
||||
embree_avx2
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
IF(EMBREE_SYCL_SUPPORT)
|
||||
SET(_embree_GPU_COMPONENTS
|
||||
embree4_sycl
|
||||
embree_rthwif
|
||||
)
|
||||
ENDIF()
|
||||
|
||||
SET(_embree_FIND_COMPONENTS
|
||||
embree${EMBREE_MAJOR_VERSION}
|
||||
${_embree_SIMD_COMPONENTS}
|
||||
${_embree_GPU_COMPONENTS}
|
||||
lexers
|
||||
math
|
||||
simd
|
||||
sys
|
||||
tasking
|
||||
)
|
||||
ELSE()
|
||||
SET(_embree_FIND_COMPONENTS
|
||||
embree${EMBREE_MAJOR_VERSION}
|
||||
)
|
||||
IF(EMBREE_SYCL_SUPPORT)
|
||||
LIST(APPEND _embree_FIND_COMPONENTS
|
||||
embree4_sycl
|
||||
)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
SET(_embree_LIBRARIES)
|
||||
FOREACH(COMPONENT ${_embree_FIND_COMPONENTS})
|
||||
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
|
||||
|
||||
FIND_LIBRARY(EMBREE_${UPPERCOMPONENT}_LIBRARY
|
||||
NAMES
|
||||
${COMPONENT}
|
||||
@ -60,18 +100,9 @@ FOREACH(COMPONENT ${_embree_FIND_COMPONENTS})
|
||||
PATH_SUFFIXES
|
||||
lib64 lib
|
||||
)
|
||||
IF(NOT EMBREE_${UPPERCOMPONENT}_LIBRARY)
|
||||
IF(EMBREE_EMBREE3_LIBRARY)
|
||||
# If we can't find all the static libraries, try to fall back to the shared library if found.
|
||||
# This allows building with a shared embree library
|
||||
SET(_embree_LIBRARIES ${EMBREE_EMBREE3_LIBRARY})
|
||||
BREAK()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
LIST(APPEND _embree_LIBRARIES "${EMBREE_${UPPERCOMPONENT}_LIBRARY}")
|
||||
ENDFOREACH()
|
||||
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set EMBREE_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
@ -85,6 +116,9 @@ ENDIF()
|
||||
|
||||
MARK_AS_ADVANCED(
|
||||
EMBREE_INCLUDE_DIR
|
||||
EMBREE_MAJOR_VERSION
|
||||
EMBREE_SYCL_SUPPORT
|
||||
EMBREE_STATIC_LIB
|
||||
)
|
||||
|
||||
FOREACH(COMPONENT ${_embree_FIND_COMPONENTS})
|
||||
|
@ -120,9 +120,8 @@ UNSET(_openexr_libs_ver)
|
||||
|
||||
IF(OPENEXR_VERSION VERSION_GREATER_EQUAL "3.0.0")
|
||||
# For OpenEXR 3.x, we also need to find the now separate Imath library.
|
||||
# For simplicity we add it to the OpenEXR includes and libraries, as we
|
||||
# have no direct dependency on Imath and it's simpler to support both
|
||||
# 2.x and 3.x this way.
|
||||
# For simplicity we also add it to the OpenEXR includes and libraries,
|
||||
# as it's simpler to support both 2.x and 3.x this way.
|
||||
|
||||
# Find include directory
|
||||
FIND_PATH(IMATH_INCLUDE_DIR
|
||||
@ -169,6 +168,12 @@ IF(OPENEXR_VERSION VERSION_GREATER_EQUAL "3.0.0")
|
||||
UNSET(_imath_build_specification)
|
||||
ENDIF()
|
||||
|
||||
IF(OPENEXR_VERSION VERSION_GREATER_EQUAL "3.0.0")
|
||||
SET(IMATH_LIBRARIES ${IMATH_LIBRARY})
|
||||
ELSE()
|
||||
SET(IMATH_LIBRARIES ${OPENEXR_IMATH_LIBRARY})
|
||||
ENDIF()
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set OPENEXR_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
@ -196,6 +201,7 @@ MARK_AS_ADVANCED(
|
||||
OPENEXR_VERSION
|
||||
IMATH_INCLUDE_DIR
|
||||
IMATH_LIBRARY
|
||||
IMATH_LIBRARIES
|
||||
)
|
||||
FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS})
|
||||
STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
|
||||
|
@ -108,6 +108,7 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(SYCL
|
||||
|
||||
IF(SYCL_FOUND)
|
||||
SET(SYCL_INCLUDE_DIR ${SYCL_INCLUDE_DIR} ${SYCL_INCLUDE_DIR}/sycl)
|
||||
SET(SYCL_LIBRARIES ${SYCL_LIBRARY})
|
||||
ELSE()
|
||||
SET(SYCL_SYCL_FOUND FALSE)
|
||||
ENDIF()
|
||||
|
@ -26,11 +26,8 @@ set(WITH_HARU ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_DDS ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_TIFF ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_WEBP ON CACHE BOOL "" FORCE)
|
||||
set(WITH_INPUT_NDOF ON CACHE BOOL "" FORCE)
|
||||
set(WITH_INPUT_IME ON CACHE BOOL "" FORCE)
|
||||
|
@ -27,11 +27,8 @@ set(WITH_HARU OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_ITASC OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_SOLVER OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_CINEON OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_DDS OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_HDR OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_OPENEXR OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_OPENJPEG OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_TIFF OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_WEBP OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_INPUT_IME OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_INPUT_NDOF OFF CACHE BOOL "" FORCE)
|
||||
|
@ -27,11 +27,8 @@ set(WITH_HARU ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_ITASC ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IK_SOLVER ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_CINEON ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_DDS ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_HDR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_OPENEXR ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_OPENJPEG ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_TIFF ON CACHE BOOL "" FORCE)
|
||||
set(WITH_IMAGE_WEBP ON CACHE BOOL "" FORCE)
|
||||
set(WITH_INPUT_NDOF ON CACHE BOOL "" FORCE)
|
||||
set(WITH_INPUT_IME ON CACHE BOOL "" FORCE)
|
||||
|
@ -1364,3 +1364,24 @@ macro(windows_generate_shared_manifest)
|
||||
)
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
macro(windows_process_platform_bundled_libraries library_deps)
|
||||
if(NOT "${library_deps}" STREQUAL "")
|
||||
set(next_library_mode "ALL")
|
||||
foreach(library ${library_deps})
|
||||
string(TOUPPER "${library}" library_upper)
|
||||
if(("${library_upper}" STREQUAL "RELEASE") OR
|
||||
("${library_upper}" STREQUAL "DEBUG") OR
|
||||
("${library_upper}" STREQUAL "ALL"))
|
||||
set(next_library_mode "${library_upper}")
|
||||
else()
|
||||
windows_install_shared_manifest(
|
||||
FILES ${library}
|
||||
${next_library_mode}
|
||||
)
|
||||
set(next_library_mode "ALL")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
@ -221,10 +221,8 @@ find_package(PNG REQUIRED)
|
||||
set(JPEG_ROOT ${LIBDIR}/jpeg)
|
||||
find_package(JPEG REQUIRED)
|
||||
|
||||
if(WITH_IMAGE_TIFF)
|
||||
set(TIFF_ROOT ${LIBDIR}/tiff)
|
||||
find_package(TIFF REQUIRED)
|
||||
endif()
|
||||
set(TIFF_ROOT ${LIBDIR}/tiff)
|
||||
find_package(TIFF REQUIRED)
|
||||
|
||||
if(WITH_IMAGE_WEBP)
|
||||
set(WEBP_ROOT_DIR ${LIBDIR}/webp)
|
||||
@ -330,6 +328,7 @@ if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
|
||||
endforeach()
|
||||
set(EMBREE_LIBRARIES ${_embree_libraries_force_load})
|
||||
endif()
|
||||
add_bundled_libraries(embree/lib)
|
||||
|
||||
if(WITH_OPENIMAGEDENOISE)
|
||||
find_package(OpenImageDenoise REQUIRED)
|
||||
@ -452,6 +451,31 @@ if(WITH_COMPILER_CCACHE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
unset(_custom_LINKER_FUSE_FLAG)
|
||||
if(WITH_LINKER_LLD)
|
||||
find_program(LLD_PROGRAM ld.lld)
|
||||
if(LLD_PROGRAM)
|
||||
set(_custom_LINKER_FUSE_FLAG "-fuse-ld=lld")
|
||||
else()
|
||||
message(WARNING "LLD linker NOT found, disabling WITH_LINKER_LLD")
|
||||
set(WITH_LINKER_LLD OFF)
|
||||
endif()
|
||||
endif()
|
||||
if(WITH_LINKER_MOLD)
|
||||
find_program(MOLD_PROGRAM mold)
|
||||
if(MOLD_PROGRAM)
|
||||
set(_custom_LINKER_FUSE_FLAG "-fuse-ld=mold")
|
||||
else()
|
||||
message(WARNING "Mold linker NOT found, disabling WITH_LINKER_MOLD")
|
||||
set(WITH_LINKER_MOLD OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(_custom_LINKER_FUSE_FLAG)
|
||||
add_link_options(${_custom_LINKER_FUSE_FLAG})
|
||||
endif()
|
||||
|
||||
|
||||
if(WITH_COMPILER_ASAN)
|
||||
list(APPEND PLATFORM_BUNDLED_LIBRARIES ${COMPILER_ASAN_LIBRARY})
|
||||
endif()
|
||||
|
@ -109,6 +109,10 @@ find_package_wrapper(ZLIB REQUIRED)
|
||||
find_package_wrapper(Zstd REQUIRED)
|
||||
find_package_wrapper(Epoxy REQUIRED)
|
||||
|
||||
# XXX Linking errors with debian static tiff :/
|
||||
# find_package_wrapper(TIFF REQUIRED)
|
||||
find_package(TIFF)
|
||||
|
||||
if(WITH_VULKAN_BACKEND)
|
||||
find_package_wrapper(Vulkan REQUIRED)
|
||||
find_package_wrapper(ShaderC REQUIRED)
|
||||
@ -190,13 +194,6 @@ if(WITH_IMAGE_OPENJPEG)
|
||||
set_and_warn_library_found("OpenJPEG" OPENJPEG_FOUND WITH_IMAGE_OPENJPEG)
|
||||
endif()
|
||||
|
||||
if(WITH_IMAGE_TIFF)
|
||||
# XXX Linking errors with debian static tiff :/
|
||||
# find_package_wrapper(TIFF)
|
||||
find_package(TIFF)
|
||||
set_and_warn_library_found("TIFF" TIFF_FOUND WITH_IMAGE_TIFF)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENAL)
|
||||
find_package_wrapper(OpenAL)
|
||||
set_and_warn_library_found("OpenAL" OPENAL_FOUND WITH_OPENAL)
|
||||
@ -317,7 +314,7 @@ if(WITH_CYCLES AND WITH_CYCLES_OSL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_CYCLES AND WITH_CYCLES_DEVICE_ONEAPI)
|
||||
if(WITH_CYCLES AND (WITH_CYCLES_DEVICE_ONEAPI OR (WITH_CYCLES_EMBREE AND EMBREE_SYCL_SUPPORT)))
|
||||
set(CYCLES_LEVEL_ZERO ${LIBDIR}/level-zero CACHE PATH "Path to Level Zero installation")
|
||||
if(EXISTS ${CYCLES_LEVEL_ZERO} AND NOT LEVEL_ZERO_ROOT_DIR)
|
||||
set(LEVEL_ZERO_ROOT_DIR ${CYCLES_LEVEL_ZERO})
|
||||
@ -453,6 +450,7 @@ add_bundled_libraries(opencolorio/lib)
|
||||
if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
|
||||
find_package(Embree 3.8.0 REQUIRED)
|
||||
endif()
|
||||
add_bundled_libraries(embree/lib)
|
||||
|
||||
if(WITH_OPENIMAGEDENOISE)
|
||||
find_package_wrapper(OpenImageDenoise)
|
||||
@ -641,15 +639,29 @@ if(WITH_GHOST_WAYLAND)
|
||||
pkg_check_modules(wayland-egl wayland-egl)
|
||||
pkg_check_modules(wayland-scanner wayland-scanner)
|
||||
pkg_check_modules(wayland-cursor wayland-cursor)
|
||||
pkg_check_modules(wayland-protocols wayland-protocols>=1.15)
|
||||
pkg_check_modules(wayland-protocols wayland-protocols>=1.31)
|
||||
pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
|
||||
else()
|
||||
# NOTE: this file must always refer to the newest API which is used, so older
|
||||
# `wayland-protocols` are never found and used which then fail to locate required protocols.
|
||||
set(_wayland_protocols_reference_file "staging/fractional-scale/fractional-scale-v1.xml")
|
||||
|
||||
# Reset the protocols directory the reference file from `wayland-protocols` is not found.
|
||||
# This avoids developers having build failures when a cached directory is used that no
|
||||
# longer contains the required file.
|
||||
if(DEFINED WAYLAND_PROTOCOLS_DIR)
|
||||
if(NOT EXISTS "${WAYLAND_PROTOCOLS_DIR}/${_wayland_protocols_reference_file}")
|
||||
unset(WAYLAND_PROTOCOLS_DIR CACHE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Rocky8 packages have too old a version, a newer version exist in the pre-compiled libraries.
|
||||
find_path(WAYLAND_PROTOCOLS_DIR
|
||||
NAMES staging/xdg-activation/xdg-activation-v1.xml
|
||||
NAMES ${_wayland_protocols_reference_file}
|
||||
PATH_SUFFIXES share/wayland-protocols
|
||||
PATHS ${LIBDIR}/wayland-protocols
|
||||
)
|
||||
unset(_wayland_protocols_reference_file)
|
||||
|
||||
if(EXISTS ${WAYLAND_PROTOCOLS_DIR})
|
||||
set(wayland-protocols_FOUND ON)
|
||||
@ -803,64 +815,49 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||
string(PREPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO "${GCC_EXTRA_FLAGS_RELEASE} ")
|
||||
unset(GCC_EXTRA_FLAGS_RELEASE)
|
||||
|
||||
# NOTE(@campbellbarton): Eventually mold will be able to use `-fuse-ld=mold`,
|
||||
# however at the moment this only works for GCC 12.1+ (unreleased at time of writing).
|
||||
# So a workaround is used here "-B" which points to another path to find system commands
|
||||
# such as `ld`.
|
||||
if(WITH_LINKER_MOLD AND _IS_LINKER_DEFAULT)
|
||||
find_program(MOLD_BIN "mold")
|
||||
mark_as_advanced(MOLD_BIN)
|
||||
|
||||
if(NOT MOLD_BIN)
|
||||
message(STATUS "The \"mold\" binary could not be found, using system linker.")
|
||||
set(WITH_LINKER_MOLD OFF)
|
||||
elseif(CMAKE_C_COMPILER_VERSION VERSION_LESS 12.1)
|
||||
message(STATUS "GCC 12.1 or newer is required for th MOLD linker.")
|
||||
set(WITH_LINKER_MOLD OFF)
|
||||
else()
|
||||
# By default mold installs the binary to:
|
||||
# - `{PREFIX}/bin/mold` as well as a symbolic-link in...
|
||||
# - `{PREFIX}/lib/mold/ld`.
|
||||
# (where `PREFIX` is typically `/usr/`).
|
||||
#
|
||||
# This block of code finds `{PREFIX}/lib/mold` from the `mold` binary.
|
||||
# Other methods of searching for the path could also be made to work,
|
||||
# we could even make our own directory and symbolic-link, however it's more
|
||||
# convenient to use the one provided by mold.
|
||||
#
|
||||
# Use the binary path to "mold", to find the common prefix which contains "lib/mold".
|
||||
# The parent directory: e.g. `/usr/bin/mold` -> `/usr/bin/`.
|
||||
get_filename_component(MOLD_PREFIX "${MOLD_BIN}" DIRECTORY)
|
||||
# The common prefix path: e.g. `/usr/bin/` -> `/usr/` to use as a hint.
|
||||
get_filename_component(MOLD_PREFIX "${MOLD_PREFIX}" DIRECTORY)
|
||||
# Find `{PREFIX}/lib/mold/ld`, store the directory component (without the `ld`).
|
||||
# Then pass `-B {PREFIX}/lib/mold` to GCC so the `ld` located there overrides the default.
|
||||
find_path(
|
||||
MOLD_BIN_DIR "ld"
|
||||
HINTS "${MOLD_PREFIX}"
|
||||
# The default path is `libexec`, Arch Linux for e.g.
|
||||
# replaces this with `lib` so check both.
|
||||
PATH_SUFFIXES "libexec/mold" "lib/mold" "lib64/mold"
|
||||
NO_DEFAULT_PATH
|
||||
NO_CACHE
|
||||
get_filename_component(MOLD_BIN_DIR "${MOLD_BIN}" DIRECTORY)
|
||||
# Check if the `-B` argument is required.
|
||||
# This will happen when `MOLD_BIN` points to a non-standard location.
|
||||
# Keep this option as mold is not yet a standard system component and
|
||||
# users may have it installed in some unexpected place.
|
||||
set(_mold_args "-fuse-ld=mold")
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} -B ${MOLD_BIN_DIR} ${_mold_args} -Wl,--version
|
||||
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION_WITH_DIR
|
||||
)
|
||||
if(NOT MOLD_BIN_DIR)
|
||||
message(STATUS
|
||||
"The mold linker could not find the directory containing the linker command "
|
||||
"(typically "
|
||||
"\"${MOLD_PREFIX}/libexec/mold/ld\") or "
|
||||
"\"${MOLD_PREFIX}/lib/mold/ld\") using system linker."
|
||||
)
|
||||
set(WITH_LINKER_MOLD OFF)
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_C_COMPILER} ${_mold_args} -Wl,--version
|
||||
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION
|
||||
)
|
||||
if(NOT (LD_VERSION STREQUAL LD_VERSION_WITH_DIR))
|
||||
string(PREPEND _mold_args "-B \"${MOLD_BIN_DIR}\" ")
|
||||
set(LD_VERSION "${LD_VERSION_WITH_DIR}")
|
||||
endif()
|
||||
unset(MOLD_PREFIX)
|
||||
endif()
|
||||
|
||||
if(WITH_LINKER_MOLD)
|
||||
# GCC will search for `ld` in this directory first.
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " -B \"${MOLD_BIN_DIR}\"")
|
||||
string(APPEND CMAKE_SHARED_LINKER_FLAGS " -B \"${MOLD_BIN_DIR}\"")
|
||||
string(APPEND CMAKE_MODULE_LINKER_FLAGS " -B \"${MOLD_BIN_DIR}\"")
|
||||
set(_IS_LINKER_DEFAULT OFF)
|
||||
if("${LD_VERSION}" MATCHES "mold ")
|
||||
string(APPEND CMAKE_EXE_LINKER_FLAGS " ${_mold_args}")
|
||||
string(APPEND CMAKE_SHARED_LINKER_FLAGS " ${_mold_args}")
|
||||
string(APPEND CMAKE_MODULE_LINKER_FLAGS " ${_mold_args}")
|
||||
set(_IS_LINKER_DEFAULT OFF)
|
||||
else()
|
||||
message(STATUS "GNU mold linker isn't available, using the default system linker.")
|
||||
endif()
|
||||
unset(_mold_args)
|
||||
unset(MOLD_BIN_DIR)
|
||||
unset(LD_VERSION)
|
||||
endif()
|
||||
unset(MOLD_BIN)
|
||||
unset(MOLD_BIN_DIR)
|
||||
endif()
|
||||
|
||||
if(WITH_LINKER_GOLD AND _IS_LINKER_DEFAULT)
|
||||
|
@ -487,14 +487,12 @@ if(WITH_IMAGE_OPENEXR)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WITH_IMAGE_TIFF)
|
||||
# Try to find tiff first then complain and set static and maybe wrong paths
|
||||
windows_find_package(TIFF)
|
||||
if(NOT TIFF_FOUND)
|
||||
warn_hardcoded_paths(libtiff)
|
||||
set(TIFF_LIBRARY ${LIBDIR}/tiff/lib/libtiff.lib)
|
||||
set(TIFF_INCLUDE_DIR ${LIBDIR}/tiff/include)
|
||||
endif()
|
||||
# Try to find tiff first then complain and set static and maybe wrong paths
|
||||
windows_find_package(TIFF)
|
||||
if(NOT TIFF_FOUND)
|
||||
warn_hardcoded_paths(libtiff)
|
||||
set(TIFF_LIBRARY ${LIBDIR}/tiff/lib/libtiff.lib)
|
||||
set(TIFF_INCLUDE_DIR ${LIBDIR}/tiff/include)
|
||||
endif()
|
||||
|
||||
if(WITH_JACK)
|
||||
@ -850,27 +848,75 @@ endif()
|
||||
if(WITH_CYCLES AND WITH_CYCLES_EMBREE)
|
||||
windows_find_package(Embree)
|
||||
if(NOT Embree_FOUND)
|
||||
set(EMBREE_ROOT_DIR ${LIBDIR}/embree)
|
||||
set(EMBREE_INCLUDE_DIRS ${LIBDIR}/embree/include)
|
||||
set(EMBREE_LIBRARIES
|
||||
optimized ${LIBDIR}/embree/lib/embree3.lib
|
||||
optimized ${LIBDIR}/embree/lib/embree_avx2.lib
|
||||
optimized ${LIBDIR}/embree/lib/embree_avx.lib
|
||||
optimized ${LIBDIR}/embree/lib/embree_sse42.lib
|
||||
optimized ${LIBDIR}/embree/lib/lexers.lib
|
||||
optimized ${LIBDIR}/embree/lib/math.lib
|
||||
optimized ${LIBDIR}/embree/lib/simd.lib
|
||||
optimized ${LIBDIR}/embree/lib/sys.lib
|
||||
optimized ${LIBDIR}/embree/lib/tasking.lib
|
||||
|
||||
debug ${LIBDIR}/embree/lib/embree3_d.lib
|
||||
debug ${LIBDIR}/embree/lib/embree_avx2_d.lib
|
||||
debug ${LIBDIR}/embree/lib/embree_avx_d.lib
|
||||
debug ${LIBDIR}/embree/lib/embree_sse42_d.lib
|
||||
debug ${LIBDIR}/embree/lib/lexers_d.lib
|
||||
debug ${LIBDIR}/embree/lib/math_d.lib
|
||||
debug ${LIBDIR}/embree/lib/simd_d.lib
|
||||
debug ${LIBDIR}/embree/lib/sys_d.lib
|
||||
debug ${LIBDIR}/embree/lib/tasking_d.lib
|
||||
if(EXISTS ${LIBDIR}/embree/include/embree4/rtcore_config.h)
|
||||
set(EMBREE_MAJOR_VERSION 4)
|
||||
else()
|
||||
set(EMBREE_MAJOR_VERSION 3)
|
||||
endif()
|
||||
|
||||
file(READ ${LIBDIR}/embree/include/embree${EMBREE_MAJOR_VERSION}/rtcore_config.h _embree_config_header)
|
||||
if(_embree_config_header MATCHES "#define EMBREE_STATIC_LIB")
|
||||
set(EMBREE_STATIC_LIB TRUE)
|
||||
else()
|
||||
set(EMBREE_STATIC_LIB FALSE)
|
||||
endif()
|
||||
|
||||
if(_embree_config_header MATCHES "#define EMBREE_SYCL_SUPPORT")
|
||||
set(EMBREE_SYCL_SUPPORT TRUE)
|
||||
else()
|
||||
set(EMBREE_SYCL_SUPPORT FALSE)
|
||||
endif()
|
||||
|
||||
set(EMBREE_LIBRARIES
|
||||
optimized ${LIBDIR}/embree/lib/embree${EMBREE_MAJOR_VERSION}.lib
|
||||
debug ${LIBDIR}/embree/lib/embree${EMBREE_MAJOR_VERSION}_d.lib
|
||||
)
|
||||
|
||||
if(EMBREE_SYCL_SUPPORT)
|
||||
set(EMBREE_LIBRARIES
|
||||
${EMBREE_LIBRARIES}
|
||||
optimized ${LIBDIR}/embree/lib/embree4_sycl.lib
|
||||
debug ${LIBDIR}/embree/lib/embree4_sycl_d.lib
|
||||
)
|
||||
endif()
|
||||
|
||||
if(EMBREE_STATIC_LIB)
|
||||
set(EMBREE_LIBRARIES
|
||||
${EMBREE_LIBRARIES}
|
||||
optimized ${LIBDIR}/embree/lib/embree_avx2.lib
|
||||
optimized ${LIBDIR}/embree/lib/embree_avx.lib
|
||||
optimized ${LIBDIR}/embree/lib/embree_sse42.lib
|
||||
optimized ${LIBDIR}/embree/lib/lexers.lib
|
||||
optimized ${LIBDIR}/embree/lib/math.lib
|
||||
optimized ${LIBDIR}/embree/lib/simd.lib
|
||||
optimized ${LIBDIR}/embree/lib/sys.lib
|
||||
optimized ${LIBDIR}/embree/lib/tasking.lib
|
||||
debug ${LIBDIR}/embree/lib/embree_avx2_d.lib
|
||||
debug ${LIBDIR}/embree/lib/embree_avx_d.lib
|
||||
debug ${LIBDIR}/embree/lib/embree_sse42_d.lib
|
||||
debug ${LIBDIR}/embree/lib/lexers_d.lib
|
||||
debug ${LIBDIR}/embree/lib/math_d.lib
|
||||
debug ${LIBDIR}/embree/lib/simd_d.lib
|
||||
debug ${LIBDIR}/embree/lib/sys_d.lib
|
||||
debug ${LIBDIR}/embree/lib/tasking_d.lib
|
||||
)
|
||||
|
||||
if(EMBREE_SYCL_SUPPORT)
|
||||
set(EMBREE_LIBRARIES
|
||||
${EMBREE_LIBRARIES}
|
||||
optimized ${LIBDIR}/embree/lib/embree_rthwif.lib
|
||||
debug ${LIBDIR}/embree/lib/embree_rthwif_d.lib
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
if(NOT EMBREE_STATIC_LIB)
|
||||
list(APPEND PLATFORM_BUNDLED_LIBRARIES
|
||||
RELEASE ${EMBREE_ROOT_DIR}/bin/embree${EMBREE_MAJOR_VERSION}.dll
|
||||
DEBUG ${EMBREE_ROOT_DIR}/bin/embree${EMBREE_MAJOR_VERSION}_d.dll
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
@ -1029,7 +1075,7 @@ endif()
|
||||
set(ZSTD_INCLUDE_DIRS ${LIBDIR}/zstd/include)
|
||||
set(ZSTD_LIBRARIES ${LIBDIR}/zstd/lib/zstd_static.lib)
|
||||
|
||||
if(WITH_CYCLES AND WITH_CYCLES_DEVICE_ONEAPI)
|
||||
if(WITH_CYCLES AND (WITH_CYCLES_DEVICE_ONEAPI OR (WITH_CYCLES_EMBREE AND EMBREE_SYCL_SUPPORT)))
|
||||
set(LEVEL_ZERO_ROOT_DIR ${LIBDIR}/level_zero)
|
||||
set(CYCLES_SYCL ${LIBDIR}/dpcpp CACHE PATH "Path to oneAPI DPC++ compiler")
|
||||
if(EXISTS ${CYCLES_SYCL} AND NOT SYCL_ROOT_DIR)
|
||||
@ -1040,8 +1086,9 @@ if(WITH_CYCLES AND WITH_CYCLES_DEVICE_ONEAPI)
|
||||
${SYCL_ROOT_DIR}/bin/sycl[0-9].dll
|
||||
)
|
||||
foreach(sycl_runtime_library IN LISTS _sycl_runtime_libraries_glob)
|
||||
string(REPLACE ".dll" "$<$<CONFIG:Debug>:d>.dll" sycl_runtime_library ${sycl_runtime_library})
|
||||