pub fn finish_frame(
        &mut self,
        image_available: vk::Semaphore,
    ) -> Result<vk::Semaphore> {
        let wait_semaphores = [image_available];
        let wait_stages = [vk::PipelineStageFlags::COLOR_ATTACHMENT_OUTPUT];
        let render_finished_signal_semaphores =
            [self.sync.render_finished_semaphore];
        let submit_info = [vk::SubmitInfo {
            p_wait_semaphores: wait_semaphores.as_ptr(),
            p_wait_dst_stage_mask: wait_stages.as_ptr(),
            wait_semaphore_count: wait_semaphores.len() as u32,
            p_command_buffers: self.command_buffers.as_ptr(),
            command_buffer_count: self.command_buffers.len() as u32,
            p_signal_semaphores: render_finished_signal_semaphores.as_ptr(),
            signal_semaphore_count: render_finished_signal_semaphores.len()
                as u32,
            ..Default::default()
        }];
        unsafe {
            self.device
                .logical_device
                .queue_submit(
                    self.device.graphics_queue.raw(),
                    &submit_info,
                    self.sync.graphics_finished_fence,
                )
                .with_context(|| "unable to submit graphics commands!")?;
        }
        Ok(self.sync.render_finished_semaphore)
    }
/// Finish the frame by submitting all command buffers to the graphics
/// queue and a semaphore which signals when rendering to the framebuffer
/// is complete.
Finish the frame by submitting all command buffers to the graphics
queue and a semaphore which signals when rendering to the framebuffer
is complete.
Finish the frame by submitting all command buffers to the graphics queue and a semaphore which signals when rendering to the framebuffer is complete .
pub fn finish_frame(
        &mut self,
        image_available: vk::Semaphore,
    ) -> Result<vk::Semaphore> {
        let wait_semaphores = [image_available];
        let wait_stages = [vk::PipelineStageFlags::COLOR_ATTACHMENT_OUTPUT];
        let render_finished_signal_semaphores =
            [self.sync.render_finished_semaphore];
        let submit_info = [vk::SubmitInfo {
            p_wait_semaphores: wait_semaphores.as_ptr(),
            p_wait_dst_stage_mask: wait_stages.as_ptr(),
            wait_semaphore_count: wait_semaphores.len() as u32,
            p_command_buffers: self.command_buffers.as_ptr(),
            command_buffer_count: self.command_buffers.len() as u32,
            p_signal_semaphores: render_finished_signal_semaphores.as_ptr(),
            signal_semaphore_count: render_finished_signal_semaphores.len()
                as u32,
            ..Default::default()
        }];
        unsafe {
            self.device
                .logical_device
                .queue_submit(
                    self.device.graphics_queue.raw(),
                    &submit_info,
                    self.sync.graphics_finished_fence,
                )
                .with_context(|| "unable to submit graphics commands!")?;
        }
        Ok(self.sync.render_finished_semaphore)
    }
pub fn finish_frame ( & mut self , image_available : vk :: Semaphore , ) -> Result < vk :: Semaphore > { let wait_semaphores = [ image_available ] ; let wait_stages = [ vk :: PipelineStageFlags :: COLOR_ATTACHMENT_OUTPUT ] ; let render_finished_signal_semaphores = [ self . sync . render_finished_semaphore ] ; let submit_info = [ vk :: SubmitInfo { p_wait_semaphores : wait_semaphores . as_ptr ( ) , p_wait_dst_stage_mask : wait_stages . as_ptr ( ) , wait_semaphore_count : wait_semaphores . len ( ) as u32 , p_command_buffers : self . command_buffers . as_ptr ( ) , command_buffer_count : self . command_buffers . len ( ) as u32 , p_signal_semaphores : render_finished_signal_semaphores . as_ptr ( ) , signal_semaphore_count : render_finished_signal_semaphores . len ( ) as u32 , .. Default :: default ( ) } ] ; unsafe { self . device . logical_device . queue_submit ( self . device . graphics_queue . raw ( ) , & submit_info , self . sync . graphics_finished_fence , ) . with_context ( | | " " ) ? ; } Ok ( self . sync . render_finished_semaphore ) }
Finish the frame by submitting all command buffers to the graphics
queue and a semaphore which signals when rendering to the framebuffer
is complete.
Finish the frame by submitting all command buffers to the graphics queue and a semaphore which signals when rendering to the framebuffer is complete .
&mut self
image_available
vk::Semaphore