deps_builder: update Embree to 4.1.0
This allows to drop patches and workarounds, and reenable Hardware Raytracing support for MNEE and Raytrace kernels for oneAPI device. Pull Request: https://projects.blender.org/blender/blender/pulls/107853
This commit is contained in:
parent
4f2ac09886
commit
3d53078dbe
|
@ -14,6 +14,7 @@ set(EMBREE_EXTRA_ARGS
|
||||||
-DEMBREE_BACKFACE_CULLING=OFF
|
-DEMBREE_BACKFACE_CULLING=OFF
|
||||||
-DEMBREE_BACKFACE_CULLING_CURVES=ON
|
-DEMBREE_BACKFACE_CULLING_CURVES=ON
|
||||||
-DEMBREE_BACKFACE_CULLING_SPHERES=ON
|
-DEMBREE_BACKFACE_CULLING_SPHERES=ON
|
||||||
|
-DEMBREE_NO_SPLASH=ON
|
||||||
-DEMBREE_TASKING_SYSTEM=TBB
|
-DEMBREE_TASKING_SYSTEM=TBB
|
||||||
-DEMBREE_TBB_ROOT=${LIBDIR}/tbb
|
-DEMBREE_TBB_ROOT=${LIBDIR}/tbb
|
||||||
-DTBB_ROOT=${LIBDIR}/tbb
|
-DTBB_ROOT=${LIBDIR}/tbb
|
||||||
|
|
|
@ -477,9 +477,9 @@ set(SQLITE_HASH_TYPE SHA1)
|
||||||
set(SQLITE_FILE sqlite-autoconf-${SQLLITE_LONG_VERSION}.tar.gz)
|
set(SQLITE_FILE sqlite-autoconf-${SQLLITE_LONG_VERSION}.tar.gz)
|
||||||
set(SQLITE_CPE "cpe:2.3:a:sqlite:sqlite:${SQLITE_VERSION}:*:*:*:*:*:*:*")
|
set(SQLITE_CPE "cpe:2.3:a:sqlite:sqlite:${SQLITE_VERSION}:*:*:*:*:*:*:*")
|
||||||
|
|
||||||
set(EMBREE_VERSION 4.0.1)
|
set(EMBREE_VERSION 4.1.0)
|
||||||
set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip)
|
set(EMBREE_URI https://github.com/embree/embree/archive/v${EMBREE_VERSION}.zip)
|
||||||
set(EMBREE_HASH dd26617719a587e126b341d1b32f7fd0)
|
set(EMBREE_HASH 4b525955b08e1249a700dea5b5ffc8b2)
|
||||||
set(EMBREE_HASH_TYPE MD5)
|
set(EMBREE_HASH_TYPE MD5)
|
||||||
set(EMBREE_FILE embree-v${EMBREE_VERSION}.zip)
|
set(EMBREE_FILE embree-v${EMBREE_VERSION}.zip)
|
||||||
|
|
||||||
|
|
|
@ -24,144 +24,3 @@ index 7c2f43d..106b1d5 100644
|
||||||
DISABLE_STACK_PROTECTOR_FOR_INTERSECTORS(${EMBREE_LIBRARY_FILES_AVX2})
|
DISABLE_STACK_PROTECTOR_FOR_INTERSECTORS(${EMBREE_LIBRARY_FILES_AVX2})
|
||||||
ADD_LIBRARY(embree_avx2 STATIC ${EMBREE_LIBRARY_FILES_AVX2})
|
ADD_LIBRARY(embree_avx2 STATIC ${EMBREE_LIBRARY_FILES_AVX2})
|
||||||
TARGET_LINK_LIBRARIES(embree_avx2 PRIVATE tasking)
|
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;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
diff -ruN a/kernels/sycl/rthwif_embree_builder.cpp b/kernels/sycl/rthwif_embree_builder.cpp
|
|
||||||
--- a/kernels/sycl/rthwif_embree_builder.cpp 2023-03-28 17:23:06.429190200 +0200
|
|
||||||
+++ b/kernels/sycl/rthwif_embree_builder.cpp 2023-03-28 17:35:01.291938600 +0200
|
|
||||||
@@ -540,7 +540,12 @@
|
|
||||||
assert(offset <= geomDescrData.size());
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /* Force running BVH building sequentially from the calling thread if using TBB < 2021, as it otherwise leads to runtime issues. */
|
|
||||||
+#if TBB_VERSION_MAJOR<2021
|
|
||||||
+ RTHWIF_PARALLEL_OPERATION parallelOperation = nullptr;
|
|
||||||
+#else
|
|
||||||
RTHWIF_PARALLEL_OPERATION parallelOperation = rthwifNewParallelOperation();
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
/* estimate static accel size */
|
|
||||||
BBox1f time_range(0,1);
|
|
||||||
|
|
Loading…
Reference in New Issue