-
Notifications
You must be signed in to change notification settings - Fork 52
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
Size of fully vendored gpu-allocator
with "d3d12"
is quite large
#181
Comments
gpu-allocator
on Windows is quite largegpu-allocator
with "d3d12"
is quite large
Afaik bindgen isn't really usable for public apis because you end up with unique types that aren't compatible with the ones from eg. windows-rs or winapi. edit: The only solution for this I've been able to come up with is a |
We previously had a |
We did try another approach on the |
Thanks for filing the issue; I understand the concern and we're also constantly fighting windows-rs because of the compile times and it's size. For us, however, Therefor, I'm very open to the suggestion of replacing @jimblandy and @Elabajaba If we go down the path of having Firefox ship with |
Understood. This is not unexpected.
Okay. Then this sounds like our best path. Yes, Firefox would need I don't think Firefox would need too much process from Traverse; most of the burden will fall on us. We already depend on lots of third-party crates much less organized than this one. We have an internal vetting process we must follow, driven by At the moment Mozilla's attention is on just getting our implementation stood up the way it needs to be (good CTS results in CI, etc). I think it's going to be a few months before we'll be seeing issues like efficient buffer allocation showing up at the top of our lists. At that point, I'd probably ask my co-worker @ErichDonGubler to take point on this work. @Elabajaba is an independent wgpu contributor, not associated with Mozilla, so if they want to work on this, that would be lovely - but that's up to them. |
Let's be more clear here. The Agility SDK (with shipping out-of-Windows DLLs and exporting magic symbols from an exe) isn't something that has to be used. Rather, the canonical latest version of the Direct3D12 API is provided by Microsoft out-of-tree at https://github.com/microsoft/DirectX-Headers. It contains types and COM objects for newer interfaces on objects, but those are optional and cannot even be used if A great example of this is #168 where we use Hence I don't think there's a need for an Rather, I think there could/should be a feature that enables some convenience APIs that allow users to pass Back on topic: that |
Firefox would very much like to use
gpu-allocator
in its Direct3D12 backend for WebGPU on Windows, but we cannot:Firefox has a policy of vendoring all our dependency crates into the source tree, to meet security requirements.
Firefox currently has a policy of not accepting the
windows
as a dependency, despite it being the officially supported bindings crate for Windows APIs, because of its size when the unpacked crate sources are vendored. As large as the Firefox sources already are, vendoringwindows
into the tree would be a notable increase. (However, Firefox does permit depending on thewindows-sys
crate.)As a result, Firefox's WebGPU implementation uses
wgpu
's Direct3D12 backend without enabling thewindows-rs
feature, meaning that we use an older, slower path that does not suballocate buffers. We'd like to put this behind us and begin usinggpu-allocator
to do things right.Right now, running
cargo vendor
in a crate that simply depends ongpu-allocator
with the"d3d12"
feature enabled produces a 238MiBvendor
subdirectory.Is there any way that
gpu-allocator
could reduce the size of its vendored footprint?Could we use
windows-bindgen
at build time to generate only the bindings we need?Are the old
winapi
bindings close enough to those fromwindows-rs
thatgpu-allocator
could have some optional configuration that went back to depending onwinapi
, using the macros to generate whatever bindings are missing?Those are just two strategies that occur to me, but any tactic to avoid bringing in
windows-rs
will serve.Mozilla is willing to do the work. We're just looking for a plan that would be acceptable for inclusion in this code base; forking would be a waste of time and attention in all the generally-understood ways.
Thanks very much for considering our situation!
Background and prior discussion
#107 goes into the reasons
gpu-allocator
migrated towindows-rs
- a move that makes perfect sense.gfx-rs/wgpu#3207 is the wgpu issue covering this question.
cc: @ErichDonGubler
The text was updated successfully, but these errors were encountered: