This commit is contained in:
parent
1dc9da0d61
commit
2590db0a06
8 changed files with 123 additions and 88 deletions
|
@ -11,10 +11,7 @@ pub struct VkRenderPass {
|
|||
}
|
||||
|
||||
impl VkRenderPass {
|
||||
pub fn new(
|
||||
device: Arc<VkDevice>,
|
||||
swapchain: Arc<VkSwapchain>,
|
||||
) -> VkResult<Self> {
|
||||
pub fn new(device: &Arc<VkDevice>, swapchain: &Arc<VkSwapchain>) -> VkResult<Self> {
|
||||
let color_attachment = vk::AttachmentDescription::default()
|
||||
.format(swapchain.surface_format.format)
|
||||
.samples(vk::SampleCountFlags::TYPE_1)
|
||||
|
@ -40,14 +37,12 @@ impl VkRenderPass {
|
|||
.attachments(&attachments)
|
||||
.subpasses(&subpasses);
|
||||
|
||||
let render_pass = unsafe {
|
||||
device.handle.create_render_pass(&render_pass_info, None)?
|
||||
};
|
||||
let render_pass = unsafe { device.handle.create_render_pass(&render_pass_info, None)? };
|
||||
log::debug!("Render pass created ({render_pass:?})");
|
||||
|
||||
Ok(Self {
|
||||
device,
|
||||
swapchain,
|
||||
device: device.clone(),
|
||||
swapchain: swapchain.clone(),
|
||||
handle: render_pass,
|
||||
})
|
||||
}
|
||||
|
@ -60,4 +55,4 @@ impl Drop for VkRenderPass {
|
|||
log::debug!("Render pass destroyed ({:?})", self.handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue