Skip to content

Add WoA Build Support for Embree#603

Open
ranjeet-mcw wants to merge 1 commit into
RenderKit:masterfrom
ranjeet-mcw:feature/embree_WOA_Support
Open

Add WoA Build Support for Embree#603
ranjeet-mcw wants to merge 1 commit into
RenderKit:masterfrom
ranjeet-mcw:feature/embree_WOA_Support

Conversation

@ranjeet-mcw
Copy link
Copy Markdown

Enable building Embree natively on Windows on ARM (ARM64) using
clang-cl, Ninja, and Visual Studio 2022 toolchain.

Changes:

  • platform.h: add NOMINMAX guard to prevent windows.h min/max macro
    conflicts with std::numeric_limits
  • sse2neon.h: add windows.h include for ARM64 Windows clang-cl builds
  • clang.cmake: add ARM64 Windows detection and compiler flag guards
    for clang-cl
  • dpcpp.cmake: guard x86 ISA flags against ARM64 Windows target
  • taskschedulertbb.cpp: suppress Windows max macro expansion using
    parentheses idiom

Tested on:
OS: Windows 11 ARM64
Compiler: clang-cl 21.1.0 (LLVM)
TBB: 2022.3 (vcpkg arm64-windows)
Runtime: embree_minimal.exe verified correct

Fixes #601

@anthony-linaro
Copy link
Copy Markdown
Contributor

anthony-linaro commented May 26, 2026

Hi @ranjeet-mcw - I'm not sure I understand the purpose of this PR - embree has been working on WoA for years now, and shipped as part of Blender. I detail the build process in #439.

Having reviewed it on the latest tip of main, those instructions still work, the only one addition of -DCOMPILER_HAS_SYCL_SUPPORT=OFF to the configure line.

Arguably this could be automatically detected and set, which would allow for building of Embree OOB again (it appears things have changed since I made the PR a few years ago, given LLVM now includes some SyCL support natively). This PR is an incorrect approach to an already solved issue.

The correct approach would be to rename this PR to Fix building for Windows ARM64 using clang-cl, and just do a set(COMPILER_HAS_SYCL_SUPPORT OFF) when WoA is detected, and SYCL not explicitly enabled via the same flag, probably here: https://github.com/RenderKit/embree/blob/master/CMakeLists.txt#L228, guarded by something like if(EMBREE_ARM AND WIN32 AND ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang" AND NOT COMPILER_HAS_SYCL_SUPPORT).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add WoA Build Support for embree

2 participants