-
-
Notifications
You must be signed in to change notification settings - Fork 163
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 static Dawn library easy to consume in other projects #109
Comments
@rsms a few questions for you: (1) Preference for single big
(2) Clone the repo and build from source (would require (3) You mentioned on Twitter noticing Dawn's binary size being quite huge, I also noticed that - it was one of the reasons I switched to per-component static libs (was looking to debug it), right now we have:
Of course an actual triangle example binary linked against them is much smaller:
But curious if you have any thoughts/concerns around this |
Thank you Stephen for making this effort!
Would you consider separating the mach code from the "static dawn lib" project? I.e. making mach a "consumer"/"user" of the dawn libraries? |
Whoa that's a cool idea!
Absolutely, yes, that's the primary thing this issue is for. A few thoughts: For Mach itself there are a lot of good reasons to prefer monorepo development, so here's how I envision this working in a way that is compatible with both your and my goals:
|
The dawn_utils part of the dawn library has various glfw interoperation bits in it. Is dawn_utils part of the effort? If so it seems like it would be a good idea to have it be a third library, so that there's no hard dependency from dawn to glfw. dawn without glfw would be good... |
@meshula Yeah, I'd like for you to be able to choose (via build.zig, and CLI parameters) which of the components to build. You may still pay the cost of downloading GLFW (not sure), but it wouldn't build. I can't say how easy Dawn is to use without |
See #133 (comment) Helps #109 Helps #133 Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
See #133 (comment) Helps #109 Helps #133 Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Fixes hexops/mach#171 Helps hexops/mach#109 Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
We've gotten a lot better here:
There's still more to do, documentation to add, etc. but overall you can consume this from other projects now without much trouble I believe. I'll close this issue, feel free to create new ones with any feedback / issues, etc. |
Latest binary release: https://github.com/hexops/mach-gpu-dawn/releases/tag/release-6b59025 |
Spawned from Twitter convo https://twitter.com/rsms/status/1465073396861992961
We are already doing a fair amount of work to enable effortless compilation (and cross-compilation) of Google's Dawn WebGPU implementation, it makes sense to have this exist in a standalone project in which anyone interested in building static Dawn without all the hassle of Google tools, dependencies, etc. can consume.
This should also include the C shims needed to access the portions of dawn_native's API needed to e.g. bind Dawn to a GLFW window and similar from C.
cc @rsms
The text was updated successfully, but these errors were encountered: