Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extensions: Only call
assume_init()
when Vulkan returns SUCCESS
It is undefined behaviour to construct a safe object by calling `MaybeUninit::assume_init()` when the object in question hasn't been initialized by anything (in this case the underlying Vulkan call) at all, even if the object is never "used". Postpone the `assume_init()` call until after checking if `vk::Result::SUCCESS` has been returned by the native implementation, by introducing a new `assume_initialized_on_success()` helper that takes a `MaybeUninit<T>`.
- Loading branch information
Showing
3 changed files
with
10 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters