Don't generate function structs for extensions that have no functions
I noticed that Ash generates quite a few structs for extensions without any functions, for example KhrSurfaceProtectedCapabilitiesFn. These structs end up empty and are rather useless. Would it be better if the generator filtered out such cases?
@Rua Are you referring to unit-like structs? The type you linked may have an empty struct, but it's the only way to get to ::name() to enable an extension in the first place, and const SPEC_VERSION is used in our application too.
I agree though, we could probably get rid of everything that's unused or makes no sense:
unsafe impl Send + Sync;- Manual
Clonetrait (already taken care of by usingderive(Clone)in https://github.com/MaikKlein/ash/pull/437#discussion_r634814420); fn load, there's nothing to load;- Make these
unit-likestructs.
Feel free to tackle this one, or wait for @MaikKlein / @Ralith to provide their opinion. The generator is already pretty loaded, but any wins we can get in ash compile time are worth taking IMO (see also #438, I hope shedding ~2k lines helps the parser at least).
Ah, I didn't realise that these structures had purposes beside loading functions.
Ah, I didn't realise that these structures had purposes beside loading functions.
The impl block containing these is (strangely) placed above the struct though, when the rest (impl block containing fn load()) is below so I'm not surprised it was missed ^^