Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Supersedes #912
Create new marker traits
ExtensionMeta
as defined below:Add marker struct
Meta
in all extension mod root.ExtensionMeta
trait is automatically implemented for allMeta
marker structs.When an extension does not have Instance or Device fp, the corresponding associated types on the trait will be defined as the unit type
()
.Why is this useful?
Higher level abstractions may want to offer a way for users to enable extensions during application startup. Instead of asking for a
&'static CStr
extension name, we could instead ask for animpl ExtensionMeta
which is significantly more idiomatic. This also gives us the promotion status of an extension, which allows the framework to behave differently depending on the core Vulkan version.Unfortunately, we cannot implement traits for modules. That's why we need the extra
Meta
type that we added on module roots. These types give us a way to refer to the whole extension as a type.