summaryrefslogtreecommitdiff
path: root/thirdparty/embree/patches/godot-changes-android.patch
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/embree/patches/godot-changes-android.patch')
-rw-r--r--thirdparty/embree/patches/godot-changes-android.patch103
1 files changed, 0 insertions, 103 deletions
diff --git a/thirdparty/embree/patches/godot-changes-android.patch b/thirdparty/embree/patches/godot-changes-android.patch
deleted file mode 100644
index a27f924bde..0000000000
--- a/thirdparty/embree/patches/godot-changes-android.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/thirdparty/embree/common/sys/sysinfo.cpp b/thirdparty/embree/common/sys/sysinfo.cpp
-index ba97dc227b..1679599608 100644
---- a/thirdparty/embree/common/sys/sysinfo.cpp
-+++ b/thirdparty/embree/common/sys/sysinfo.cpp
-@@ -618,7 +618,10 @@ namespace embree
- static int nThreads = -1;
- if (nThreads != -1) return nThreads;
-
--#if defined(__MACOSX__)
-+// -- GODOT start --
-+// #if defined(__MACOSX__)
-+#if defined(__MACOSX__) || defined(__ANDROID__)
-+// -- GODOT end --
- nThreads = sysconf(_SC_NPROCESSORS_ONLN); // does not work in Linux LXC container
- assert(nThreads);
- #else
-diff --git a/thirdparty/embree/common/sys/thread.cpp b/thirdparty/embree/common/sys/thread.cpp
-index a7827e18f7..f4014be89b 100644
---- a/thirdparty/embree/common/sys/thread.cpp
-+++ b/thirdparty/embree/common/sys/thread.cpp
-@@ -158,7 +158,9 @@ namespace embree
- /// Linux Platform
- ////////////////////////////////////////////////////////////////////////////////
-
--#if defined(__LINUX__)
-+// -- GODOT start --
-+#if defined(__LINUX__) && !defined(__ANDROID__)
-+// -- GODOT end --
-
- #include <fstream>
- #include <sstream>
-@@ -247,6 +249,28 @@ namespace embree
- }
- #endif
-
-+// -- GODOT start --
-+////////////////////////////////////////////////////////////////////////////////
-+/// Android Platform
-+////////////////////////////////////////////////////////////////////////////////
-+
-+#if defined(__ANDROID__)
-+
-+namespace embree
-+{
-+ /*! set affinity of the calling thread */
-+ void setAffinity(ssize_t affinity)
-+ {
-+ cpu_set_t cset;
-+ CPU_ZERO(&cset);
-+ CPU_SET(affinity, &cset);
-+
-+ sched_setaffinity(0, sizeof(cset), &cset);
-+ }
-+}
-+#endif
-+// -- GODOT end --
-+
- ////////////////////////////////////////////////////////////////////////////////
- /// FreeBSD Platform
- ////////////////////////////////////////////////////////////////////////////////
-@@ -355,7 +379,9 @@ namespace embree
- pthread_attr_destroy(&attr);
-
- /* set affinity */
--#if defined(__LINUX__)
-+// -- GODOT start --
-+#if defined(__LINUX__) && !defined(__ANDROID__)
-+// -- GODOT end --
- if (threadID >= 0) {
- cpu_set_t cset;
- CPU_ZERO(&cset);
-@@ -370,7 +396,16 @@ namespace embree
- CPU_SET(threadID, &cset);
- pthread_setaffinity_np(*tid, sizeof(cset), &cset);
- }
-+// -- GODOT start --
-+#elif defined(__ANDROID__)
-+ if (threadID >= 0) {
-+ cpu_set_t cset;
-+ CPU_ZERO(&cset);
-+ CPU_SET(threadID, &cset);
-+ sched_setaffinity(pthread_gettid_np(*tid), sizeof(cset), &cset);
-+ }
- #endif
-+// -- GODOT end --
-
- return thread_t(tid);
- }
-@@ -389,8 +424,14 @@ namespace embree
-
- /*! destroy a hardware thread by its handle */
- void destroyThread(thread_t tid) {
-+// -- GODOT start --
-+#if defined(__ANDROID__)
-+ FATAL("Can't destroy threads on Android.");
-+#else
- pthread_cancel(*(pthread_t*)tid);
- delete (pthread_t*)tid;
-+#endif
-+// -- GODOT end --
- }
-
- /*! creates thread local storage */