Skip to content
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

Don't generate function structs for extensions that have no functions #442

Closed
Rua opened this issue May 25, 2021 · 3 comments · Fixed by #752
Closed

Don't generate function structs for extensions that have no functions #442

Rua opened this issue May 25, 2021 · 3 comments · Fixed by #752

Comments

@Rua
Copy link
Contributor

Rua commented May 25, 2021

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?

@MarijnS95
Copy link
Collaborator

@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:

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).

@Rua
Copy link
Contributor Author

Rua commented May 25, 2021

Ah, I didn't realise that these structures had purposes beside loading functions.

@MarijnS95
Copy link
Collaborator

MarijnS95 commented May 25, 2021

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 ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants