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 Packed24_8 helper-type for constructing AS Instance bitfields #476

Merged
merged 2 commits into from
Oct 2, 2021

Conversation

MarijnS95
Copy link
Collaborator

Fixes #474, cc @expenses

Draft because we can possibly improve API design here by making a special type instead of u32 that has this as a constructor? This doesn't include a full builder yet, but if we do anything more fancy than this we should move these types to a new file directly included in ash/vk/ instead of having static text (that doesn't depend on anything from the autogeneration process) hardcoded in the generator.

generator/src/lib.rs Outdated Show resolved Hide resolved
@Rua
Copy link
Contributor

Rua commented Sep 25, 2021

I think using a custom type is more idiomatic, and conveys to the user that it's not just a single integer. If the inner u32 is kept private, it can also prevent incorrect usage.

Much like `platform_types.rs` `vk.rs` does not contain any generated
code that depends on `Vulkan-Headers`' `vk.xml`, making it easier to
just keep this file manually editable.
@MarijnS95 MarijnS95 changed the title Add pack_24_8 helper function for constructing AS Instances Add Packed24_8 helper-type for constructing AS Instance bitfields Sep 27, 2021
@MarijnS95 MarijnS95 marked this pull request as ready for review September 27, 2021 21:46
@MarijnS95
Copy link
Collaborator Author

@Rua Yup, got it done :)

Regarding making vk.rs a manual file and adding prelude.rs, what's everyones view on adopting the auto folder/module from GTK where the generator spits its outputs (src/vk/auto/), and everything outside that (straight in the root of src/vk/) is manual files? Should make it a bit easier to understand which of the files are safe to touch by hand, and which files are left to the generator.

ash/src/vk/prelude.rs Show resolved Hide resolved
Copy link

@expenses expenses left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@MaikKlein MaikKlein merged commit e10bbf3 into ash-rs:master Oct 2, 2021
@MarijnS95 MarijnS95 deleted the as-instance-bitfield branch October 2, 2021 10:38
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 this pull request may close these issues.

AccelerationStructureInstanceKHR is missing a builder
4 participants