Skip to content

Commit

Permalink
entry: Mark Entry::from_parts_1_1() as unsafe
Browse files Browse the repository at this point in the history
`Entry` is the only struct marking some Vulkan API calls as safe, as
their soundness can be trivially upheld.  This however relies on
`vkGetInstanceProcAddr` returning a sound function pointer, which is not
something we can guarantee when the user passes us function pointers via
`Entry::from_parts_1_1()` instead: hence mark this new constructor as
`unsafe` to uphold this contract.

Related discussion chain: #748 (comment)
  • Loading branch information
MarijnS95 committed May 26, 2023
1 parent 53c395b commit adb8650
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added `VK_EXT_shader_object` device extension (#732)
- Added missing `Device::get_device_queue2()` wrapper (#736)
- Exposed `FramebufferCreateInfo::attachment_count()` builder for `vk::FramebufferCreateFlags::IMAGELESS` (#747)
- Allow building `Entry`/`Instance`/`Device` from handle+fns (#748)
- Allow building `Entry`/`Instance`/`Device` from handle+fns (see their `from_parts_x_x()` associated functions) (#748)

### Changed

Expand Down
2 changes: 1 addition & 1 deletion ash/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl Entry {
}

#[inline]
pub fn from_parts_1_1(
pub unsafe fn from_parts_1_1(
static_fn: vk::StaticFn,
entry_fn_1_0: vk::EntryFnV1_0,
entry_fn_1_1: vk::EntryFnV1_1,
Expand Down

0 comments on commit adb8650

Please sign in to comment.