ash_window: Make enumerate_required_extensions()
return all available surface extensions irrespective of a window handle
#595
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.
Currently,
ash_window::enumerate_required_extensions
accepts a&dyn HasRawWindowHandle
. It then returns a list of&'static CStr
based on the type of theRawWindowHandle
. This seems fine on the surface, however it's making a few implicit assumptions:ash::Instance
RawWindowHandle
used during the lifetime ofash::Instance
will have the same type.The first assumption limits the usability of this function. For example, when integrating ash directly with bevy, it would be preferred to create the Instance on application startup within the AppBuilder. The window could be created a few frames later when bevy actually sends out the
WindowCreated
event.The second scenario is unlikely in the real world, but there's no guarantee that a multi-window linux application wouldn't have a Xlib window and a Wayland window at the same time.
So, instead of enumerating platform-specific extensions based on the
RawWindowHandler
, this PR makes it so thatash_window::enumerate_required_extensions
only requires aash::Entry
. It would then enumerate the supported extension list and enable all platform-specific surface extensions. In the case that no such extension exist, the API should throwERROR_EXTENSION_NOT_PRESENT
.TODO: fix example
related: #590