-
Notifications
You must be signed in to change notification settings - Fork 192
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 vk.rs
to new vulkan-sys crate
#93
Conversation
vk.sys
to new ash-sys cratevk.rs
to new ash-sys crate
Do we want |
What's about the current header version, which is used for generating vk.rs?
|
Changes to the generator will inevitably force the version number to diverge from upstream's sooner or later. On another subject, I wonder if it would be appropriate to grab a more generic name like |
|
My thought was that, being a raw binding, it's sufficiently un-opinionated to be of use by others, e.g. vulkano. Not much point in factoring out the -sys part if it's never going to be used by anyone else, after all. |
Sorry I meant I still think the version should be separate and that means the workspace dependency should also require an explicit version. |
I really don't think using the vulkan.h version makes sense, unless we want to commit to never, ever making another breaking change to the structure of the output. |
I think @MaikKlein has to decide this. Pro:
Con:
|
vk.rs
to new ash-sys cratevk.rs
to new vulkan-sys crate
It's perfectly legal to use a newer binding with an older vulkan implementation, and it will be immediately obvious (and easily corrected) if the binding doesn't have something you need. This also breaks down permanently the first time a breaking generator change happens.
However rare breaking changes to the behavior of the generator are, they will almost certainly happen inevitably, rendering the whole endeavor futile. |
Here are my thoughts: Using the vulkan version is well indented, but as @Ralith said, will be futile. I think the name With explicit versioning I mean starting from One thing I think is a bit weird is how we would mark breaking changes in a semver manner. Now if Is |
I'm a bit fuzzy on the motivation too. It would be aesthetically pleasing for the various vulkan crates to agree on a common -sys layer (and occasionally useful for type-safe interop, e.g. in windowing and VR libraries), but perhaps we should get buy-in from the other maintainers before investing effort in it. |
Rerenamed to |
In general, gfx-backend-vulkan would like to use a lower level crate to do things. |
The biggest benefit is that const names are currently still missing but will be implemented very soon and the function pointer loading will become similar to vulkano, where null pointers will resolve into a function that always panics. At the moment ash just panics if anything fails to load. I'll merge this PR before the next version of |
That's really opinionated, but I don't really like that. However that's not a strong enough argument to not switch vulkano to ash-sys, I guess. |
@tomaka's complaints could be addressed by generating two separate files: one for the sys crate which contains nothing but type and constant definitions, and another that implements the idiomatic rust wrappers, strong types, loading, etc. and goes in the ash crate. |
I am okay with this. We could generally try to make everything more configurable, for example allow different naming schemes etc Although this probably will require some refactoring. My only concern is that we might end up with too many versions of ash-sys, which might not be compatible with each other. |
To be clear, I'm not proposing multiple versions of the -sys crate, just splitting what is currently vk.rs into two parts: the sys crate, which is absolutely nothing but a faithful FFI binding, and a module in the ash crate, which provides the zero-cost safer wrappers we know and love by wrapping parts of the sys crate as needed. |
Has there been any progress on this? As a new customer of Vulkan, it's hard to jump into an API that abstracts out so much. It'd be nice to have a raw Vulkan API that doesn't require reading complex macros or building a bunch of wrapper structs. |
I don't think ash's API requires you to use macros or construct wrapper structs at any point. |
I'm talking about using raw vulkan generator. If you want to use raw vk calls, you can follow suit to what vulkano and ash are doing, but I think it's a little complicated than just loading the library, constructing the pointer and being good to go. I don't really want to start with Ash or Vulkano, I'd rather see the footguns for myself. |
To be clear, ash is nothing like vulkano; there is practically no abstraction, just trivial (but convenient) syntax sugar. It's almost identical to what you'd write in C. |
Gotcha, maybe I'm worrying about nothing. I get antsy when I see issues like: #100, where it looks like an abstraction that won't let you use the raw functionality of Vulkan. Thank you for the responses. |
Yeah, issues like that are rare, and are considered to be bugs. |
Closes #91
This change is