Build and ship DXC on Windows - #20
Merged
Merged
Conversation
Without DAWN_USE_BUILT_DXC, dawn forces the d3d12 backend onto FXC. FXC was measured ~45x slower than DXC on a compute rasterizer and can hang the device (crbug.com/566251711). With built DXC, dawn prefers DXC wherever the adapter supports shader model 6.0+, falling back to FXC otherwise. dxcompiler.dll and DXC's license notices are copied into dist/win32-<arch>/ beside dawn.node, where dawn loads it from and where CI already uploads and publishes from. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dj2
reviewed
Sep 30, 2026
| // supports shader model 6.0+. copyResult ships dxcompiler.dll alongside. | ||
| ...addElemIf(isWin, '-DDAWN_USE_BUILT_DXC=ON'), | ||
| // dawn otherwise keeps DXC's asserts in release builds, where they trap. | ||
| ...addElemIf(isWin, '-DDAWN_DXC_ENABLE_ASSERTS_IN_NDEBUG=OFF'), |
Contributor
There was a problem hiding this comment.
Is there a need to turn this off? Those asserts do a lot of work to make DXC safer to use.
There was a problem hiding this comment.
We enable asserts in release primarily for security reasons. Keeping them off should make DXC run faster, although we've never measured the performance gain. Whether you want to enable this or not depends on the use-case for node-webgpu.
Contributor
|
@amaiorano does this look correct to you since you did a lot of the DXC integration work? |
Looks good to me. |
dj2
approved these changes
Sep 30, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes https://issues.chromium.org/issues/566251711
Without
DAWN_USE_BUILT_DXC, Dawn forces the D3D12 backend onto FXC. On a Gaussian splat compute rasterizer, FXC ran the raster pass 44–51x slower than DXC (1241 ms vs 28 ms and 1166 ms vs 23 ms on two frames) and could hang the device withDXGI_ERROR_DEVICE_HUNG. The issue has the controlled comparison.Changes
build/build.js: on Windows, configure with-DDAWN_USE_BUILT_DXC=ON. Dawn's default platform then prefers DXC wherever the adapter supports shader model 6.0+ and falls back to FXC otherwise, so no runtime toggle is needed.build/build.js: copydxcompiler.dllintodist/win32-<arch>/besidedawn.node, where Dawn loads it from. CI already uploads and publishes that whole directory, so the workflow only needed a comment update.LICENSE.TXTandThirdPartyNotices.txtship alongside asdxcompiler-LICENSE.TXTanddxcompiler-ThirdPartyNotices.txt.gclient syncalready fetches DXC at the revision pinned in Dawn's DEPS.Open question
-DDAWN_DXC_ENABLE_ASSERTS_IN_NDEBUG=OFFmatches the configuration tested in the issue. Dawn's default is ON, which keeps DXC's asserts in release builds so an internal DXC failure traps instead of continuing. Happy to drop the flag if you'd rather keep Dawn's default.Cost
Compressed CI artifact size and job time, compared with the latest
mainrun:Linux and macOS artifacts are unchanged.
Testing
npm teston my fork: https://github.com/slimbuck/node-webgpu/actions/runs/36700462458 (Windows x64 tests run on WARP).win32-x64package on Windows.