Upgrade Embree to the latest official release.
Since Embree v3.13.0 supports AARCH64, switch back to the official repo instead of using Embree-aarch64. `thirdparty/embree/patches/godot-changes.patch` should now contain an accurate diff of the changes done to the library.
This commit is contained in:
parent
42b6602f1d
commit
767e374dce
350 changed files with 13009 additions and 11315 deletions
|
|
@ -10,7 +10,7 @@ env_raycast = env_modules.Clone()
|
|||
thirdparty_obj = []
|
||||
|
||||
if env["builtin_embree"]:
|
||||
thirdparty_dir = "#thirdparty/embree-aarch64/"
|
||||
thirdparty_dir = "#thirdparty/embree/"
|
||||
|
||||
embree_src = [
|
||||
"common/sys/sysinfo.cpp",
|
||||
|
|
@ -28,16 +28,6 @@ if env["builtin_embree"]:
|
|||
"common/lexers/stringstream.cpp",
|
||||
"common/lexers/tokenstream.cpp",
|
||||
"common/tasking/taskschedulerinternal.cpp",
|
||||
"common/algorithms/parallel_for.cpp",
|
||||
"common/algorithms/parallel_reduce.cpp",
|
||||
"common/algorithms/parallel_prefix_sum.cpp",
|
||||
"common/algorithms/parallel_for_for.cpp",
|
||||
"common/algorithms/parallel_for_for_prefix_sum.cpp",
|
||||
"common/algorithms/parallel_partition.cpp",
|
||||
"common/algorithms/parallel_sort.cpp",
|
||||
"common/algorithms/parallel_set.cpp",
|
||||
"common/algorithms/parallel_map.cpp",
|
||||
"common/algorithms/parallel_filter.cpp",
|
||||
"kernels/common/device.cpp",
|
||||
"kernels/common/stat.cpp",
|
||||
"kernels/common/acceln.cpp",
|
||||
|
|
@ -82,13 +72,17 @@ if env["builtin_embree"]:
|
|||
if env["platform"] == "windows":
|
||||
if env.msvc:
|
||||
env.Append(LINKFLAGS=["psapi.lib"])
|
||||
env_raycast.Append(CPPDEFINES=["__SSE2__", "__SSE__"])
|
||||
else:
|
||||
env.Append(LIBS=["psapi"])
|
||||
|
||||
env_thirdparty = env_raycast.Clone()
|
||||
env_thirdparty.disable_warnings()
|
||||
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
|
||||
|
||||
if not env["arch"] in ["x86", "x86_64"] or env.msvc:
|
||||
# Embree needs those, it will automatically use SSE2NEON in ARM
|
||||
env_thirdparty.Append(CPPDEFINES=["__SSE2__", "__SSE__"])
|
||||
|
||||
env.modules_sources += thirdparty_obj
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
def can_build(env, platform):
|
||||
# Depends on Embree library, which supports only x86_64 (originally)
|
||||
# and aarch64 (thanks to the embree-aarch64 fork).
|
||||
# Depends on Embree library, which only supports x86_64 and aarch64.
|
||||
|
||||
if platform == "android":
|
||||
return env["android_arch"] in ["arm64v8", "x86_64"]
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ include_dirs = [
|
|||
"common/algorithms",
|
||||
"common/lexers",
|
||||
"common/simd",
|
||||
"common/simd/arm",
|
||||
"include/embree3",
|
||||
"kernels/subdiv",
|
||||
"kernels/geometry",
|
||||
|
|
@ -32,16 +33,6 @@ cpp_files = [
|
|||
"common/lexers/stringstream.cpp",
|
||||
"common/lexers/tokenstream.cpp",
|
||||
"common/tasking/taskschedulerinternal.cpp",
|
||||
"common/algorithms/parallel_for.cpp",
|
||||
"common/algorithms/parallel_reduce.cpp",
|
||||
"common/algorithms/parallel_prefix_sum.cpp",
|
||||
"common/algorithms/parallel_for_for.cpp",
|
||||
"common/algorithms/parallel_for_for_prefix_sum.cpp",
|
||||
"common/algorithms/parallel_partition.cpp",
|
||||
"common/algorithms/parallel_sort.cpp",
|
||||
"common/algorithms/parallel_set.cpp",
|
||||
"common/algorithms/parallel_map.cpp",
|
||||
"common/algorithms/parallel_filter.cpp",
|
||||
"kernels/common/device.cpp",
|
||||
"kernels/common/stat.cpp",
|
||||
"kernels/common/acceln.cpp",
|
||||
|
|
@ -74,11 +65,11 @@ cpp_files = [
|
|||
|
||||
os.chdir("../../thirdparty")
|
||||
|
||||
dir_name = "embree-aarch64"
|
||||
dir_name = "embree"
|
||||
if os.path.exists(dir_name):
|
||||
shutil.rmtree(dir_name)
|
||||
|
||||
subprocess.run(["git", "clone", "https://github.com/lighttransport/embree-aarch64.git", "embree-tmp"])
|
||||
subprocess.run(["git", "clone", "https://github.com/embree/embree.git", "embree-tmp"])
|
||||
os.chdir("embree-tmp")
|
||||
|
||||
commit_hash = str(subprocess.check_output(["git", "rev-parse", "HEAD"], universal_newlines=True)).strip()
|
||||
|
|
@ -197,7 +188,7 @@ with open("CMakeLists.txt", "r") as cmake_file:
|
|||
with open(os.path.join(dest_dir, "include/embree3/rtcore_config.h"), "w") as config_file:
|
||||
config_file.write(
|
||||
f"""
|
||||
// Copyright 2009-2020 Intel Corporation
|
||||
// Copyright 2009-2021 Intel Corporation
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
#pragma once
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue