-
Notifications
You must be signed in to change notification settings - Fork 952
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
Static linking for DXC via mach-dxcompiler #6574
Conversation
4d4a2bf
to
38346d6
Compare
Update on the current state of this PR: The branch builds and I am able to successfully use static DXC in my own WGPU project on From what I gather, the correct solution here is to offer both an I will be asking around on the Zig forums (and maybe opening an issue on Zig's GitHub) about this. In the meantime, I will leave this PR open. If anyone has additional guidance or suggestions for how we can push this PR forward, I would be grateful. Otherwise, this PR is stagnant until we find a way to build static libs with |
Well, after a good deal of more foraging, I managed to find the compiler flag that I was looking for: Zig accepts |
I'm just curious, do you know if |
@Elabajaba, that's a great question. The DXC branch that's actually being built is here - it hasn't been updated in about a year, so it doesn't support SM 6.8 at this time. In theory it should be possible to update it to latest, but I took a look and there are merge conflicts with DXC master. I don't know how easy it would be. |
I saw that |
Other than that, this looks good to me, @cwfitzgerald what do you think? |
If we get this in we can probably close #4155. |
99480ed
to
79ac1d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Broadly looks good, some notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff, one last nit, then let's land!
Connections
Description
This PR adds support for statically linking the DXC binaries from
mach-dxcompiler
. Themach-dxcompiler
repo replaces Microsoft's DXC build system with Zig, which allows for building DXC as a static.lib
file. I have created an upstream crate calledmach-dxcompiler-rs
that handles downloading a prebuiltmach-dxcompiler
binary and linking it into a Rust project (ideally, it would be built from source, but that was too complicated for my purposes - it can be added later if desired).This PR adds a dependency on
mach-dxcompiler-rs
, gated behind themach-dxcompiler-rs
feature flag. When enabled, it allows for specifyingdx12_shader_compiler: Dx12Compiler::MachDxc
in theInstanceDescriptor
. This allows for using DXC in WGPU without having to ship any external.dll
s alongside the main binary.Checklist
cargo fmt
.taplo format
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
--target wasm32-unknown-emscripten
cargo xtask test
to run tests.CHANGELOG.md
. See simple instructions inside file.