Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect the ISA extension when building Embree and adjust its build configuration to match #95158

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Oct 3, 2024

  1. Configuration menu
    Copy the full SHA
    d78363d View commit details
    Browse the repository at this point in the history
  2. 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.
    MonterraByte committed Oct 3, 2024
    Configuration menu
    Copy the full SHA
    8b50351 View commit details
    Browse the repository at this point in the history