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>,
|
device: Arc<Device>,
|
||||||
swapchain_ci: &VkSwapchainCreateInfoKHR,
|
swapchain_ci: &VkSwapchainCreateInfoKHR,
|
||||||
) -> Result<Arc<Self>> {
|
) -> Result<Arc<Self>> {
|
||||||
Ok(Self::from_raw(
|
Ok(Arc::new(Swapchain {
|
||||||
device.clone(),
|
width: AtomicU32::new(swapchain_ci.imageExtent.width),
|
||||||
swapchain_ci,
|
height: AtomicU32::new(swapchain_ci.imageExtent.height),
|
||||||
device.create_swapchain(swapchain_ci)?,
|
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(
|
pub fn from_raw(
|
||||||
|
|
Loading…
Reference in a new issue