-
Notifications
You must be signed in to change notification settings - Fork 950
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
Make spirv an optional feature #1518
Conversation
Regarding #1520 -- should that still be enabled without spirv? I'd say yes because this feature is related to parsing priv, not using spirv, but the name could get confusing. |
@ElectronicRU Yes, I was just thinking about the same. Perhaps, we should adjust the (run-time) feature name to spell it more clearly. |
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 think we should go ahead with this, the compile time improvement is nothing to shake a stick at
Interestingly if we did allow naga modules to be provided as mentioned on Matrix recently, we wouldn't need SPIR-V specific options here. i.e. the application/library could opt-in to the SPIR-V frontend in naga |
It does predicate that naga can actually parse the spirv, which is one of the things passing raw spirv is trying to get around in #1525 |
@grovesNL indeed. It would have to be passed by move though, because wgpu wants to own Naga's module, but these modules aren't cloneable (at least today). |
@grovesNL @cwfitzgerald I added a commit that removes SPIR-V support entirely from One of the nasty trade-offs here is being able to API trace the run involving SPIR-V. Since it's not in |
I'd be really hesitant to merge removing spirv entirely right now. I do think this is eventually where we want to be, but having things be predicated on naga understanding every shader means that a good chunk of our features are unusable because naga is yet unaware of them. spirv was basically our last way around any current limitations of naga. I think in some time we should reconsider. |
This functionality is here, it stays, and it's no directly related to this PR. See #1525 Also, the current state of the PR is still keeping SPIRV parsing support, just at wgpu-rs level instead of wgpu-core level. |
Oh I see, so we're just removing spirv ingestion from wgpu-core in the safe path. That sounds reasonable to me. I've got some nits, but otherwise LGTM. |
bors r=cwfitzgerald |
Connections
gfx-rs/naga#940 shows how much SPIR-V parsing can be a pain.
Description
Keep it supported natively, but put it behind a feature flag. This allows to skip compilation of parts of Naga as well as dependencies like
petgraph
.On my machine, compiling
wgpu-core
time is reduced from 40.87s to 35.36s, which is about 13% improvement.Testing
Just compiling