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 6, 2023
1 parent 499c7b4 commit e1d0771
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_1_3(
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 e1d0771

Please sign in to comment.