-
Notifications
You must be signed in to change notification settings - Fork 938
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
Updated Dxc integration for DX12 backend #3356
Conversation
…t called if `Dxil` fails && Refactored `source_name` calculation .
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.
Some comments:
Figure out why it's working on my machine if I only have dxil.dll, and not dxcompiler.dll in the folder
You probably have the windows sdk, which includes dxc.
Figure out how we should enable and disable DXC
I think we should have a feature at the wgpu-hal level, but not at the wgpu level. wgpu
the crate unconditionally depends on it.
Figure out what the fallback should be if the user enables DXC, but the .dlls aren't available (crash with an error message? Fall back to dxc but log the error?)
We should warn in the case the user wants dxc, but the path isn't found, then fall back to FXC.
Figure out how we should enable and disable DXC, and whether that's at runtime/compiletime/startup/etc
I'm thinking of this enum sitting in an InstanceDescriptor:
enum Dx12Compiler {
#[default]
Fxc,
Dxc { dxil_path: Option<String>, dxc_path: Option<String> },
}
Fix all the tests in github actions being broken because the .dlls are missing
We likely should default our tests to be fxc only, but with a flag they can enable DXC support. FF etc will be using fxc, so it's the most important path.
71ddf7b
to
89b76b5
Compare
Codecov Report
@@ Coverage Diff @@
## master #3356 +/- ##
==========================================
+ Coverage 65.23% 65.49% +0.26%
==========================================
Files 86 66 -20
Lines 42772 37420 -5352
==========================================
- Hits 27901 24508 -3393
+ Misses 14871 12912 -1959
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
A few changes, and a reminder for myself that I need to retest this on my laptop.
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.
This is really shaping up well. Got some comments, but nothing show stopping!
… no longer Optional in hal
I think everything should be cleaned up now. |
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.
Amazing stuff!
Checklist
cargo clippy
.RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown
if applicable.crash with an error message?Fall back to fxc but log the error)Figure out why it's working on my machine if I only have dxil.dll, and not dxcompiler.dll in the folderI have the Windows SDK installedFix all the tests in github actions being broken because the .dlls are missingCurrently defaults to using FXC.Connections
Closes #2722
Builds off of, and closes #3147
Description
wgpu currently uses the old, slow, unmaintained FXC shader compiler for DX12. This allows use of Microsoft's newer faster shader compiler and also allows use of ShaderModel 6.0 instead of being limited to SM 5.1.
Testing
Tested both the FXC and DXC paths by running
cargo nextest
, as well as running the examples.