use anyhow::Result; use vulkanalia::prelude::v1_0::*; use crate::app::AppData; pub(crate) unsafe fn create_framebuffers(device: &Device, data: &mut AppData) -> Result<()> { data.framebuffers = data .swapchain_image_views .iter() .map(|i| { let attachments = &[data.color_image_view, data.depth_image_view, *i]; let create_info = vk::FramebufferCreateInfo::builder() .render_pass(data.render_pass) .attachments(attachments) .width(data.swapchain_extent.width) .height(data.swapchain_extent.height) .layers(1); device.create_framebuffer(&create_info, None) }) .collect::, _>>()?; Ok(()) }