Embree: bump (#4128)

This commit is contained in:
miqlas
2019-08-31 00:08:33 +02:00
committed by waddlesplash
parent ff47f37be9
commit 097347cc2b
2 changed files with 110 additions and 130 deletions

View File

@@ -8,19 +8,22 @@ processors with support for SSE, AVX, AVX2, and AVX-512. Embree \
supports runtime code selection to choose the traversal and build \
algorithms that best matches the instruction set of your CPU"
HOMEPAGE="https://embree.github.io"
COPYRIGHT="2013-2017 Intel Corporation"
COPYRIGHT="2013-2019 Intel Corporation"
LICENSE="Apache v2"
REVISION="3"
REVISION="1"
SOURCE_URI="https://github.com/embree/embree/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="29b78b13728f81ced69ad24edb0bfe3f5e0298b83648371636394c9ecbc08752"
CHECKSUM_SHA256="3c179aa09efe1f591f277cd8835e37726998f657730ca456d08f584fc8780559"
PATCHES="embree-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
libVersion="$portVersion"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
embree$secondaryArchSuffix = $portVersion
lib:libembree$secondaryArchSuffix = 2.17.6 compat >= 2
lib:libembree3$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
@@ -33,8 +36,7 @@ REQUIRES="
PROVIDES_devel="
embree${secondaryArchSuffix}_devel = $portVersion
cmd:embree2$secondaryArchSuffix
devel:libembree$secondaryArchSuffix = 2.17.6 compat >= 2
devel:libembree3$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
embree$secondaryArchSuffix == $portVersion base
@@ -56,16 +58,20 @@ BUILD_PREREQUIRES="
cmd:pkg_config$secondaryArchSuffix
cmd:sed
"
defineDebugInfoPackage embree$secondaryArchSuffix \
"$libDir"/libembree3.so.$libVersion
BUILD()
{
mkdir -p haiku_build
cd haiku_build
cmake $cmakeDirArgs \
cmake $cmakeDirArgs \
.. \
-DEMBREE_TUTORIALS=OFF \
-DEMBREE_ISPC_SUPPORT=OFF \
-DEMBREE_TASKING_SYSTEM=OFF \
..
-DBUILD_TESTING=ON
make $jobArgs
}
@@ -74,13 +80,18 @@ INSTALL()
cd haiku_build
make install
prepareInstalledDevelLib libembree
prepareInstalledDevelLib libembree3
fixPkgconfig
# devel package
packageEntries devel \
$developDir \
$binDir \
$libDir/cmake
}
TEST()
{
cd haiku_build
make test
}

View File

@@ -1,99 +1,11 @@
From dbe060fad2b764cbe49812864389fdbfb1323e9e Mon Sep 17 00:00:00 2001
From f84bf30cb06b3fb70e374415377399f966d84d98 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Sat, 11 Nov 2017 10:59:41 +0100
Subject: Embree: Haiku platform support
diff --git a/common/sys/alloc.cpp b/common/sys/alloc.cpp
index e24df4e..d51fd84 100644
--- a/common/sys/alloc.cpp
+++ b/common/sys/alloc.cpp
@@ -262,6 +262,8 @@ namespace embree
hugepages = true;
return ptr;
}
+#elif defined(__HAIKU__)
+ hugepages = false;
#else
void* ptr = mmap(0, bytes, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_HUGETLB, -1, 0);
if (ptr != MAP_FAILED) {
diff --git a/common/sys/platform.h b/common/sys/platform.h
index 4f834ef..eea43f2 100644
--- a/common/sys/platform.h
+++ b/common/sys/platform.h
@@ -85,6 +85,13 @@
# endif
#endif
+/* detect Haiku platform */
+#if defined(__HAIKU__)
+# if !defined(__UNIX__)
+# define __UNIX__
+# endif
+#endif
+
/* try to detect other Unix systems */
#if defined(__unix__) || defined (unix) || defined(__unix) || defined(_unix)
# if !defined(__UNIX__)
diff --git a/common/sys/sysinfo.cpp b/common/sys/sysinfo.cpp
index 2a6dfed..9284cf6 100644
--- a/common/sys/sysinfo.cpp
+++ b/common/sys/sysinfo.cpp
@@ -49,6 +49,10 @@ namespace embree
return "Mac OS X (32bit)";
#elif defined(__MACOSX__) && defined(__X86_64__)
return "Mac OS X (64bit)";
+#elif defined(__HAIKU__) && !defined(__X86_64__)
+ return "Haiku (32bit)";
+#elif defined(__HAIKU__) && defined(__X86_64__)
+ return "Haiku (64bit)";
#elif defined(__UNIX__) && !defined(__X86_64__)
return "Unix (32bit)";
#elif defined(__UNIX__) && defined(__X86_64__)
@@ -406,7 +410,7 @@ namespace embree
/// Linux Platform
////////////////////////////////////////////////////////////////////////////////
-#if defined(__LINUX__)
+#if defined(__LINUX__) || defined(__HAIKU__)
#include <stdio.h>
#include <unistd.h>
diff --git a/tutorials/common/math/sampling.h b/tutorials/common/math/sampling.h
index 46444f0..1bec7b3 100644
--- a/tutorials/common/math/sampling.h
+++ b/tutorials/common/math/sampling.h
@@ -26,6 +26,18 @@
namespace embree {
+#ifdef __HAIKU__
+/* FIXME! */
+inline void sincosf (float x, float* sine, float* cosine)
+{
+ #if defined(__GNUC__) && defined(__linux__) && !defined(__clang__)
+ __builtin_sincosf(x, sine, cosine);
+ #else
+ *sine = std::sin(x);
+ *cosine = std::cos(x);
+ #endif
+}
+#endif
inline Vec3fa cartesian(const float phi, const float sinTheta, const float cosTheta)
{
--
2.19.1
From 3597bd1a386a817b7ddf7a3038c4e6523bc6132e Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 24 Nov 2018 17:07:38 +0100
Subject: fix for Haiku x86
Date: Sat, 24 Aug 2019 09:32:55 +0200
Subject: Applied patches
diff --git a/common/math/math.h b/common/math/math.h
index bd66796..4bdfa05 100644
index caef5aa..2007bda 100644
--- a/common/math/math.h
+++ b/common/math/math.h
@@ -176,7 +176,10 @@ namespace embree
@@ -120,8 +32,28 @@ index bd66796..4bdfa05 100644
__forceinline size_t max(size_t a, size_t b) { return a<b ? b:a; }
#endif
diff --git a/common/sys/alloc.cpp b/common/sys/alloc.cpp
index e24df4e..8f0453a 100644
--- a/common/sys/alloc.cpp
+++ b/common/sys/alloc.cpp
@@ -253,6 +253,7 @@ namespace embree
return nullptr;
}
+#ifndef __HAIKU__
/* try direct huge page allocation first */
if (isHugePageCandidate(bytes))
{
@@ -270,6 +271,7 @@ namespace embree
}
#endif
}
+#endif
/* fallback to 4k pages */
void* ptr = (char*) mmap(0, bytes, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
diff --git a/common/sys/array.h b/common/sys/array.h
index db61047..efdfe36 100644
index d64ebb1..a0b9a5c 100644
--- a/common/sys/array.h
+++ b/common/sys/array.h
@@ -152,7 +152,7 @@ namespace embree
@@ -134,53 +66,90 @@ index db61047..efdfe36 100644
__forceinline const Ty& operator[](const size_t i) const { assert(i<N); return data[i]; }
#endif
diff --git a/common/sys/intrinsics.h b/common/sys/intrinsics.h
index d59a16e..e486d2e 100644
index 5ec477c..8355bd8 100644
--- a/common/sys/intrinsics.h
+++ b/common/sys/intrinsics.h
@@ -87,7 +87,7 @@ namespace embree
#endif
}
-#if defined(__X86_64__)
+#if defined(__X86_64__) || defined (__HAIKU__)
__forceinline size_t bsf(size_t v) {
#if defined(__AVX2__)
return _tzcnt_u64(v);
@@ -111,7 +111,7 @@ namespace embree
return i;
}
-#if defined(__X86_64__)
+#if defined(__X86_64__) || defined (__HAIKU__)
__forceinline size_t __bscf(size_t& v)
__forceinline size_t bscf(size_t& v)
{
size_t i = __bsf(v);
@@ -240,7 +239,7 @@ namespace embree
#endif
}
-#if defined(__X86_64__)
+#if defined(__X86_64__) || defined (__HAIKU__)
__forceinline unsigned __bsf(unsigned v)
{
#if defined(__AVX2__)
@@ -406,6 +405,12 @@ namespace embree
__forceinline unsigned __popcnt(unsigned in) {
size_t i = bsf(v);
@@ -407,6 +407,12 @@ namespace embree
return _mm_popcnt_u32(in);
}
+
+#if !defined(__X86_64__) && defined(__HAIKU__)
+ __forceinline size_t __popcnt(size_t in) {
+ return _mm_popcnt_u32(in);
+ }
+#endif
+
#if defined(__X86_64__)
__forceinline size_t __popcnt(size_t in) {
__forceinline size_t popcnt(size_t in) {
return _mm_popcnt_u64(in);
diff --git a/common/sys/platform.h b/common/sys/platform.h
index 477fa6f..c0778e8 100644
--- a/common/sys/platform.h
+++ b/common/sys/platform.h
@@ -86,7 +86,7 @@
#endif
/* try to detect other Unix systems */
-#if defined(__unix__) || defined (unix) || defined(__unix) || defined(_unix)
+#if defined(__unix__) || defined (unix) || defined(__unix) || defined(_unix) || defined(__HAIKU__)
# if !defined(__UNIX__)
# define __UNIX__
# endif
diff --git a/common/sys/sysinfo.cpp b/common/sys/sysinfo.cpp
index e5aa1d9..e070000 100644
--- a/common/sys/sysinfo.cpp
+++ b/common/sys/sysinfo.cpp
@@ -53,6 +53,10 @@ namespace embree
return "Unix (32bit)";
#elif defined(__UNIX__) && defined(__X86_64__)
return "Unix (64bit)";
+#elif defined(__HAIKU__) && !defined(__X86_64__)
+ return "Haiku (32bit)";
+#elif defined(__HAIKU__) && defined(__X86_64__)
+ return "Haiku (64bit)";
#else
return "Unknown";
#endif
@@ -435,7 +439,7 @@ namespace embree
/// Linux Platform
////////////////////////////////////////////////////////////////////////////////
-#if defined(__LINUX__)
+#if defined(__LINUX__) || defined(__HAIKU__)
#include <stdio.h>
#include <unistd.h>
diff --git a/kernels/builders/bvh_builder_sah.h b/kernels/builders/bvh_builder_sah.h
index 307d78c..34072f0 100644
index 6418a9b..5de64ff 100644
--- a/kernels/builders/bvh_builder_sah.h
+++ b/kernels/builders/bvh_builder_sah.h
@@ -52,7 +52,7 @@ namespace embree
@@ -55,7 +55,7 @@ namespace embree
{
if (RTC_BUILD_SETTINGS_HAS(settings,maxBranchingFactor)) branchingFactor = settings.maxBranchingFactor;
if (RTC_BUILD_SETTINGS_HAS(settings,maxDepth )) maxDepth = settings.maxDepth;
- if (RTC_BUILD_SETTINGS_HAS(settings,sahBlockSize )) logBlockSize = __bsr(settings.sahBlockSize);
+ if (RTC_BUILD_SETTINGS_HAS(settings,sahBlockSize )) logBlockSize = __bsr((size_t)settings.sahBlockSize);
if (RTC_BUILD_SETTINGS_HAS(settings,minLeafSize )) minLeafSize = settings.minLeafSize;
if (RTC_BUILD_SETTINGS_HAS(settings,maxLeafSize )) maxLeafSize = settings.maxLeafSize;
if (RTC_BUILD_SETTINGS_HAS(settings,travCost )) travCost = settings.travCost;
if (RTC_BUILD_ARGUMENTS_HAS(settings,maxBranchingFactor)) branchingFactor = settings.maxBranchingFactor;
if (RTC_BUILD_ARGUMENTS_HAS(settings,maxDepth )) maxDepth = settings.maxDepth;
- if (RTC_BUILD_ARGUMENTS_HAS(settings,sahBlockSize )) logBlockSize = bsr(settings.sahBlockSize);
+ if (RTC_BUILD_ARGUMENTS_HAS(settings,sahBlockSize )) logBlockSize = bsr((size_t)settings.sahBlockSize);
if (RTC_BUILD_ARGUMENTS_HAS(settings,minLeafSize )) minLeafSize = settings.minLeafSize;
if (RTC_BUILD_ARGUMENTS_HAS(settings,maxLeafSize )) maxLeafSize = settings.maxLeafSize;
if (RTC_BUILD_ARGUMENTS_HAS(settings,traversalCost )) travCost = settings.traversalCost;
--
2.19.1
2.23.0