unsafe fn read_barrier(
        &self,
        command_buffer: vk::CommandBuffer,
        mip_level: u32,
    ) {
        let read_barrier = vk::ImageMemoryBarrier {
            old_layout: vk::ImageLayout::TRANSFER_DST_OPTIMAL,
            new_layout: vk::ImageLayout::SHADER_READ_ONLY_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::TRANSFER_WRITE,
            dst_access_mask: vk::AccessFlags::SHADER_READ,
            ..Default::default()
        };
        self.device.logical_device.cmd_pipeline_barrier(
            command_buffer,
            vk::PipelineStageFlags::TRANSFER,
            vk::PipelineStageFlags::FRAGMENT_SHADER,
            vk::DependencyFlags::empty(),
            &[],
            &[],
            &[read_barrier],
        );
    }
/// Transition the image memory layout such that is is optimal for reading
/// within the fragment shader.
Transition the image memory layout such that is is optimal for reading
within the fragment shader.
Transition the image memory layout such that is is optimal for reading within the fragment shader .
unsafe fn read_barrier(
        &self,
        command_buffer: vk::CommandBuffer,
        mip_level: u32,
    ) {
        let read_barrier = vk::ImageMemoryBarrier {
            old_layout: vk::ImageLayout::TRANSFER_DST_OPTIMAL,
            new_layout: vk::ImageLayout::SHADER_READ_ONLY_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::TRANSFER_WRITE,
            dst_access_mask: vk::AccessFlags::SHADER_READ,
            ..Default::default()
        };
        self.device.logical_device.cmd_pipeline_barrier(
            command_buffer,
            vk::PipelineStageFlags::TRANSFER,
            vk::PipelineStageFlags::FRAGMENT_SHADER,
            vk::DependencyFlags::empty(),
            &[],
            &[],
            &[read_barrier],
        );
    }
unsafe fn read_barrier ( & self , command_buffer : vk :: CommandBuffer , mip_level : u32 , ) { let read_barrier = vk :: ImageMemoryBarrier { old_layout : vk :: ImageLayout :: TRANSFER_DST_OPTIMAL , new_layout : vk :: ImageLayout :: SHADER_READ_ONLY_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 :: TRANSFER_WRITE , dst_access_mask : vk :: AccessFlags :: SHADER_READ , .. Default :: default ( ) } ; self . device . logical_device . cmd_pipeline_barrier ( command_buffer , vk :: PipelineStageFlags :: TRANSFER , vk :: PipelineStageFlags :: FRAGMENT_SHADER , vk :: DependencyFlags :: empty ( ) , & [ ] , & [ ] , & [ read_barrier ] , ) ; }
Transition the image memory layout such that is is optimal for reading
within the fragment shader.
Transition the image memory layout such that is is optimal for reading within the fragment shader .
&self
command_buffer
vk::CommandBuffer
mip_level
u32