Skip to content

Commit

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

pub fn from_parts(
handle: vk::Device,
device_fn_1_0: vk::DeviceFnV1_0,
device_fn_1_1: vk::DeviceFnV1_1,
device_fn_1_2: vk::DeviceFnV1_2,
device_fn_1_3: vk::DeviceFnV1_3,
) -> Self {
Self {
handle,

device_fn_1_0,
device_fn_1_1,
device_fn_1_2,
device_fn_1_3,
}
}

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

0 comments on commit 1b3e35a

Please sign in to comment.