Make swapchain from_ci not raw
This commit is contained in:
parent
382d8e1179
commit
8e5e6a8c3c
1 changed files with 18 additions and 5 deletions
|
@ -133,11 +133,24 @@ impl Swapchain {
|
|||
device: Arc<Device>,
|
||||
swapchain_ci: &VkSwapchainCreateInfoKHR,
|
||||
) -> Result<Arc<Self>> {
|
||||
Ok(Self::from_raw(
|
||||
device.clone(),
|
||||
swapchain_ci,
|
||||
device.create_swapchain(swapchain_ci)?,
|
||||
))
|
||||
Ok(Arc::new(Swapchain {
|
||||
width: AtomicU32::new(swapchain_ci.imageExtent.width),
|
||||
height: AtomicU32::new(swapchain_ci.imageExtent.height),
|
||||
usage: swapchain_ci.imageUsage,
|
||||
index: AtomicU32::new(0),
|
||||
|
||||
surface: Surface::from_vk_surface(
|
||||
swapchain_ci.surface,
|
||||
device.physical_device().instance(),
|
||||
),
|
||||
|
||||
create_info: Mutex::new(swapchain_ci.clone()),
|
||||
|
||||
swapchain: Mutex::new(device.create_swapchain(swapchain_ci)?),
|
||||
device,
|
||||
|
||||
raw: false,
|
||||
}))
|
||||
}
|
||||
|
||||
pub fn from_raw(
|
||||
|
|
Loading…
Reference in a new issue