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

Add into_builder next to builder method #480

Closed
Rua opened this issue Oct 7, 2021 · 2 comments
Closed

Add into_builder next to builder method #480

Rua opened this issue Oct 7, 2021 · 2 comments

Comments

@Rua
Copy link
Contributor

Rua commented Oct 7, 2021

In my code, I set the non-pointer members of Vulkan structs using the struct notation directly, before setting the pointers at the end. Because of the safety advantages, I would like to set pointers using the builder, but I find it unnecessary to set everything else using the builder as well. So I propose adding a method into_builder alongside the existing builder method, that unlike the latter takes self by value and uses it as a basis for creating the new builder. Using this, I could create a struct by directly setting members, convert it into a builder, and use that to set the pointer members. If you think it's appropriate, the into_builder method could set any pointer members to null explicitly so that the lifetimes are correct.

@MarijnS95
Copy link
Collaborator

See also #441.

@MarijnS95
Copy link
Collaborator

The builders are now gone and the builder helper functions are now implemented directly on the Vulkan structs since #602, so this should work OOTB now 🎉

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

No branches or pull requests

2 participants