-
Notifications
You must be signed in to change notification settings - Fork 194
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
move bin/naga.rs to a separate crate in workspace #938
Conversation
Maybe we can enable all features for bin target? And remove all feature gates from the bin code. Are there any disadvantages, except compile time? |
I don't see any, except maybe binary size. Here's the (approximate) difference in compile speed:
|
I'm getting warmed up to this path, especially since |
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.
We should strongly add env_logger
dependency now and uncomment the first line in main()
naga-cli/Cargo.toml
Outdated
[[bin]] | ||
name = "naga" | ||
path = "src/main.rs" | ||
|
||
[dependencies] | ||
naga = { path = "../" } | ||
naga = { path = "../", features = ["wgsl-in", "wgsl-out", "glsl-in", "glsl-out", "spv-in", "spv-out", "msl-out", "hlsl-out", "dot-out"] } |
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.
I wish there was "all_features = true"
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.
The serialize
and deserialize
features aren't needed anyway. glsl-validate
should probably be enabled as well?
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.
we can keep the serialization off now, indeed, but the validation for GLSL should be ON
naga-cli/src/main.rs
Outdated
@@ -288,10 +269,7 @@ fn main() { | |||
} | |||
other => { | |||
let _ = params; |
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.
no longer needed (here and in other places)
Also |
4ee5332
to
f50e262
Compare
I added the |
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.
thank you!
* move bin/naga.rs to a separate crate * enable all shader languages for naga binary * [naga-cli] add env logger * [naga-cli] remove unneccessary code * [naga-cli]enable glsl-validate feature * move naga-cli to cli, add trailing newline * remove commented env_logger dependency
Splitting this off #934 for a place to discuss this change.
Because of the
default-members
, runningcargo run --features spv-out,wgsl-in input.wgsl output.spv
still works.A disadvantage is that all the cargo features have to be duplicated.