pub fn create_command_buffers(
        &mut self,
        command_buffer_level: vk::CommandBufferLevel,
        count: u32,
    ) -> VkResult<Vec<vk::CommandBuffer>> {
        log::trace!(
            "Creating command buffers from pool {:?}",
            self.command_pool_meta
        );

        let command_buffer_allocate_info = vk::CommandBufferAllocateInfo::builder()
            .command_pool(self.command_pool)
            .level(command_buffer_level)
            .command_buffer_count(count);

        let command_buffers = unsafe {
            self.device_context
                .device()
                .allocate_command_buffers(&command_buffer_allocate_info)
        }?;

        // Add the command buffers to the allocated list so we can free them later in
        // reset_command_pool
        for command_buffer in &command_buffers {
            self.allocated_command_buffers.push(*command_buffer);
        }

        Ok(command_buffers)
    }
/// Allocates command buffers from the pool
Allocates command buffers from the pool
Allocates command buffers from the pool
pub fn create_command_buffers(
        &mut self,
        command_buffer_level: vk::CommandBufferLevel,
        count: u32,
    ) -> VkResult<Vec<vk::CommandBuffer>> {
        log::trace!(
            "Creating command buffers from pool {:?}",
            self.command_pool_meta
        );
        let command_buffer_allocate_info = vk::CommandBufferAllocateInfo::builder()
            .command_pool(self.command_pool)
            .level(command_buffer_level)
            .command_buffer_count(count);
        let command_buffers = unsafe {
            self.device_context
                .device()
                .allocate_command_buffers(&command_buffer_allocate_info)
        }?;
        // Add the command buffers to the allocated list so we can free them later in
        // reset_command_pool
        for command_buffer in &command_buffers {
            self.allocated_command_buffers.push(*command_buffer);
        }
        Ok(command_buffers)
    }
pub fn create_command_buffers ( & mut self , command_buffer_level : vk :: CommandBufferLevel , count : u32 , ) -> VkResult < Vec < vk :: CommandBuffer > > { log :: trace ! ( " " self command_pool_meta ) ; let command_buffer_allocate_info = vk :: CommandBufferAllocateInfo :: builder ( ) . command_pool ( self . command_pool ) . level ( command_buffer_level ) . command_buffer_count ( count ) ; let command_buffers = unsafe { self . device_context . device ( ) . allocate_command_buffers ( & command_buffer_allocate_info ) } ? ; // Add the command buffers to the allocated list so we can free them later in // reset_command_pool for command_buffer in & command_buffers { self . allocated_command_buffers . push ( * command_buffer ) ; } Ok ( command_buffers ) }
Allocates command buffers from the pool
Allocates command buffers from the pool
&mut self
command_buffer_level
vk::CommandBufferLevel
count
u32
&mut self
command_buffer_level
vk::CommandBufferLevel
count
u32