Skip to content

Fix SHADERMAKE_TOOL building as x64 in Arm64-to-x64 cross builds - #27

Merged
dzhdanNV merged 1 commit into
NVIDIA-RTX:mainfrom
calhsu-nvidia:calhsu/host-tool-platform
Oct 5, 2026
Merged

dzhdanNV merged 1 commit into
NVIDIA-RTX:mainfrom
calhsu-nvidia:calhsu/host-tool-platform

Conversation

@calhsu-nvidia

Copy link
Copy Markdown
Contributor

When SHADERMAKE_TOOL is ON, ShaderMake is built as a separate external project so it can run during the parent build. With the Visual Studio generator, its platform was only mapped for x64 hosts (AMD64 → x64). Any other host inherited the parent's CMAKE_GENERATOR_PLATFORM. So an x64 build (-A x64) on a Windows Arm64 host produced an x64 ShaderMake.exe, which then ran under emulation.

The external project now targets the host platform: ARM64 when HOST_IS_ARM64 is set, x64 otherwise. Non-Visual Studio generators get no platform, as before. This uses the same HOST_IS_ARM64 that already selects the DXC and Slang binaries, so the tool and the compilers it launches always match the host.

Testing

Visual Studio 2022, CMake 4.4.3, full shader set of a downstream project (95 DXIL + 95 SPIR-V):

Host CMake -A SHADERMAKE_TOOL ShaderMake.exe DXC used Result
x64 x64 x64 OFF x64 bin/x64 pass
x64 x64 ARM64 ON x64 bin/x64 pass
Arm64 Arm64 ARM64 OFF ARM64 bin/arm64 pass
Arm64 Arm64 x64 ON ARM64 (x64 before this change) bin/arm64 pass

With Visual Studio, a host other than x64 inherited the parent's
platform, so an x64 build on an Arm64 host built an x64 ShaderMake that
ran under emulation.
@dzhdanNV

dzhdanNV commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Thanks. Calvin. Seems to be a good change. Merged!

@dzhdanNV
dzhdanNV merged commit df56e57 into NVIDIA-RTX:main Oct 5, 2026
3 of 4 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants