Skip to content

Commit

Permalink
ash/instance: Allow building instance from handle+fns
Browse files Browse the repository at this point in the history
Adds a constructor to build an instance device from a handle + functions.
Helps with interoperability with other vulkan wrappers
  • Loading branch information
pac85 committed May 3, 2023
1 parent 1b3e35a commit 683fdd3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ash/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,23 @@ impl Instance {
}
}

pub fn from_parts(
handle: vk::Instance,
instance_fn_1_0: vk::InstanceFnV1_0,
instance_fn_1_1: vk::InstanceFnV1_1,
instance_fn_1_2: vk::InstanceFnV1_2,
instance_fn_1_3: vk::InstanceFnV1_3,
) -> Self {
Self {
handle,

instance_fn_1_0,
instance_fn_1_1,
instance_fn_1_2,
instance_fn_1_3,
}
}

#[inline]
pub fn handle(&self) -> vk::Instance {
self.handle
Expand Down

0 comments on commit 683fdd3

Please sign in to comment.