pub unsafe fn write_barrier(
        &self,
        command_buffer: vk::CommandBuffer,
        mip_level: u32,
    ) {
        let write_barrier = vk::ImageMemoryBarrier {
            old_layout: vk::ImageLayout::UNDEFINED,
            new_layout: vk::ImageLayout::TRANSFER_DST_OPTIMAL,
            image: self.image,
            subresource_range: vk::ImageSubresourceRange {
                aspect_mask: vk::ImageAspectFlags::COLOR,
                base_mip_level: mip_level,
                level_count: 1,
                base_array_layer: 0,
                layer_count: 1,
            },
            src_access_mask: vk::AccessFlags::empty(),
            dst_access_mask: vk::AccessFlags::TRANSFER_WRITE,
            ..Default::default()
        };
        self.device.logical_device.cmd_pipeline_barrier(
            command_buffer,
            vk::PipelineStageFlags::TOP_OF_PIPE,
            vk::PipelineStageFlags::TRANSFER,
            vk::DependencyFlags::empty(),
            &[],
            &[],
            &[write_barrier],
        );
    }
/// Transition the image memory layout such that it is an optimal transfer
/// target.
Transition the image memory layout such that it is an optimal transfer
target.
Transition the image memory layout such that it is an optimal transfer target .
pub unsafe fn write_barrier(
        &self,
        command_buffer: vk::CommandBuffer,
        mip_level: u32,
    ) {
        let write_barrier = vk::ImageMemoryBarrier {
            old_layout: vk::ImageLayout::UNDEFINED,
            new_layout: vk::ImageLayout::TRANSFER_DST_OPTIMAL,
            image: self.image,
            subresource_range: vk::ImageSubresourceRange {
                aspect_mask: vk::ImageAspectFlags::COLOR,
                base_mip_level: mip_level,
                level_count: 1,
                base_array_layer: 0,
                layer_count: 1,
            },
            src_access_mask: vk::AccessFlags::empty(),
            dst_access_mask: vk::AccessFlags::TRANSFER_WRITE,
            ..Default::default()
        };
        self.device.logical_device.cmd_pipeline_barrier(
            command_buffer,
            vk::PipelineStageFlags::TOP_OF_PIPE,
            vk::PipelineStageFlags::TRANSFER,
            vk::DependencyFlags::empty(),
            &[],
            &[],
            &[write_barrier],
        );
    }
pub unsafe fn write_barrier ( & self , command_buffer : vk :: CommandBuffer , mip_level : u32 , ) { let write_barrier = vk :: ImageMemoryBarrier { old_layout : vk :: ImageLayout :: UNDEFINED , new_layout : vk :: ImageLayout :: TRANSFER_DST_OPTIMAL , image : self . image , subresource_range : vk :: ImageSubresourceRange { aspect_mask : vk :: ImageAspectFlags :: COLOR , base_mip_level : mip_level , level_count : 1 , base_array_layer : 0 , layer_count : 1 , } , src_access_mask : vk :: AccessFlags :: empty ( ) , dst_access_mask : vk :: AccessFlags :: TRANSFER_WRITE , .. Default :: default ( ) } ; self . device . logical_device . cmd_pipeline_barrier ( command_buffer , vk :: PipelineStageFlags :: TOP_OF_PIPE , vk :: PipelineStageFlags :: TRANSFER , vk :: DependencyFlags :: empty ( ) , & [ ] , & [ ] , & [ write_barrier ] , ) ; }
Transition the image memory layout such that it is an optimal transfer
target.
Transition the image memory layout such that it is an optimal transfer target .
&self
command_buffer
vk::CommandBuffer
mip_level
u32