-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detect the ISA extension when building Embree and adjust its build co…
…nfiguration to match Embree has specialized implementations for various ISA extensions to improve performance. Its code uses preprocessor definitions to detect which extension to use. Typically, its code is compiled multiple times, with different extensions enabled, and, at runtime, it detects which one should be used. Godot's build system doesn't do this, it simply compiles Embree once, for the base SSE2 instruction set, and uses that. However, it doesn't properly guarantee that it is built correctly. If Godot is compiled for a newer instruction set (such as by using `-march=x86-64-v3` with GCC/Clang, or `/arch:AVX2` with MSVC), Embree will end up with mixed code paths, and compilation will fail. (Additionally, Godot's copy of the Embree source code omits files that are not used by SSE2 builds, but are needed for AVX builds, which causes more build errors.) This commit fixes the compilation issues by finding the highest Embree ISA extension target that's compatible with the compiler flags set by the user, and adjusting the build settings accordingly.
- Loading branch information
1 parent
f53212c
commit f2aba40
Showing
1 changed file
with
117 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters