pub fn begin_command_buffer(
        &mut self,
        command_buffer_level: vk::CommandBufferLevel,
        command_buffer_usage_flags: vk::CommandBufferUsageFlags,
        inheritance_info: Option<&vk::CommandBufferInheritanceInfo>,
    ) -> VkResult<vk::CommandBuffer> {
        let inner = self.inner.as_mut().unwrap();
        log::trace!(
            "DynCommandWriter({}) begin_command_buffer Level: {:?} Usage Flags: {:?} Inheritance Info: {:?}",
            inner.writer_id,
            command_buffer_level,
            command_buffer_usage_flags,
            inheritance_info
        );

        assert!(self.currently_writing.is_none());
        let mut begin_info =
            vk::CommandBufferBeginInfo::builder().flags(command_buffer_usage_flags);

        if let Some(inheritance_info) = inheritance_info {
            begin_info = begin_info.inheritance_info(inheritance_info);
        }

        let command_buffer = inner.pool.create_command_buffers(command_buffer_level, 1)?[0];

        unsafe {
            inner
                .device_context
                .device()
                .begin_command_buffer(command_buffer, &*begin_info)?;
        }
        self.currently_writing = Some(command_buffer);
        Ok(command_buffer)
    }
/// Allocate a command buffer and call vkBeginCommandBuffer on it
Allocate a command buffer and call vkBeginCommandBuffer on it
Allocate a command buffer and call vkBeginCommandBuffer on it
pub fn begin_command_buffer(
        &mut self,
        command_buffer_level: vk::CommandBufferLevel,
        command_buffer_usage_flags: vk::CommandBufferUsageFlags,
        inheritance_info: Option<&vk::CommandBufferInheritanceInfo>,
    ) -> VkResult<vk::CommandBuffer> {
        let inner = self.inner.as_mut().unwrap();
        log::trace!(
            "DynCommandWriter({}) begin_command_buffer Level: {:?} Usage Flags: {:?} Inheritance Info: {:?}",
            inner.writer_id,
            command_buffer_level,
            command_buffer_usage_flags,
            inheritance_info
        );
        assert!(self.currently_writing.is_none());
        let mut begin_info =
            vk::CommandBufferBeginInfo::builder().flags(command_buffer_usage_flags);
        if let Some(inheritance_info) = inheritance_info {
            begin_info = begin_info.inheritance_info(inheritance_info);
        }
        let command_buffer = inner.pool.create_command_buffers(command_buffer_level, 1)?[0];
        unsafe {
            inner
                .device_context
                .device()
                .begin_command_buffer(command_buffer, &*begin_info)?;
        }
        self.currently_writing = Some(command_buffer);
        Ok(command_buffer)
    }
pub fn begin_command_buffer ( & mut self , command_buffer_level : vk :: CommandBufferLevel , command_buffer_usage_flags : vk :: CommandBufferUsageFlags , inheritance_info : Option < & vk :: CommandBufferInheritanceInfo > , ) -> VkResult < vk :: CommandBuffer > { let inner = self . inner . as_mut ( ) . unwrap ( ) ; log :: trace ! ( " " inner writer_id command_buffer_level command_buffer_usage_flags inheritance_info ) ; assert ! ( self currently_writing is_none ( ) ) ; let mut begin_info = vk :: CommandBufferBeginInfo :: builder ( ) . flags ( command_buffer_usage_flags ) ; if let Some ( inheritance_info ) = inheritance_info { begin_info = begin_info . inheritance_info ( inheritance_info ) ; } let command_buffer = inner . pool . create_command_buffers ( command_buffer_level , 1 ) ? [ 0 ] ; unsafe { inner . device_context . device ( ) . begin_command_buffer ( command_buffer , & * begin_info ) ? ; } self . currently_writing = Some ( command_buffer ) ; Ok ( command_buffer ) }
Allocate a command buffer and call vkBeginCommandBuffer on it
Allocate a command buffer and call vkBeginCommandBuffer on it
&mut self
command_buffer_level
vk::CommandBufferLevel
command_buffer_usage_flags
vk::CommandBufferUsageFlags
inheritance_info
Option<&vk::CommandBufferInheritanceInfo>
&mut self
command_buffer_level
vk::CommandBufferLevel
command_buffer_usage_flags
vk::CommandBufferUsageFlags
inheritance_info
Option<&vk::CommandBufferInheritanceInfo>