pub unsafe fn flush_mapped_buffer(&self, logical_device: &ash::Device) -> VkResult<()> {
        // if memory type isn't coherent we must flush our writes manually
        if self
            .buffer
            .memory_type
            .property_flags
            .contains(vk::MemoryPropertyFlags::HOST_COHERENT)
            == false
        {
            let mapped_range = [vk::MappedMemoryRange::builder()
                .memory(self.buffer.memory)
                .offset(0)
                .size(vk::WHOLE_SIZE)
                .build()];

            logical_device.flush_mapped_memory_ranges(&mapped_range)?;
        }

        Ok(())
    }
// called to ensure that host writes to the pixel buffer mapped memory are made
// visible to the device
// NOTE: since we guarantee that the device won't be writing to the pixel buffer,
// we don't need an 'invalidate_mapped_buffer' counterpart to this function
called to ensure that host writes to the pixel buffer mapped memory are made
visible to the device
NOTE: since we guarantee that the device won't be writing to the pixel buffer,
we don't need an 'invalidate_mapped_buffer' counterpart to this function
called to ensure that host writes to the pixel buffer mapped memory are made visible to the device NOTE : since we guarantee that the device won ' t be writing to the pixel buffer we don ' t need an ' invalidate_mapped_buffer ' counterpart to this function
pub unsafe fn flush_mapped_buffer(&self, logical_device: &ash::Device) -> VkResult<()> {
        // if memory type isn't coherent we must flush our writes manually
        if self
            .buffer
            .memory_type
            .property_flags
            .contains(vk::MemoryPropertyFlags::HOST_COHERENT)
            == false
        {
            let mapped_range = [vk::MappedMemoryRange::builder()
                .memory(self.buffer.memory)
                .offset(0)
                .size(vk::WHOLE_SIZE)
                .build()];
            logical_device.flush_mapped_memory_ranges(&mapped_range)?;
        }
        Ok(())
    }
pub unsafe fn flush_mapped_buffer ( & self , logical_device : & ash :: Device ) -> VkResult < ( ) > { // if memory type isn't coherent we must flush our writes manually if self . buffer . memory_type . property_flags . contains ( vk :: MemoryPropertyFlags :: HOST_COHERENT ) == false { let mapped_range = [ vk :: MappedMemoryRange :: builder ( ) . memory ( self . buffer . memory ) . offset ( 0 ) . size ( vk :: WHOLE_SIZE ) . build ( ) ] ; logical_device . flush_mapped_memory_ranges ( & mapped_range ) ? ; } Ok ( ( ) ) }
called to ensure that host writes to the pixel buffer mapped memory are made
visible to the device
NOTE: since we guarantee that the device won't be writing to the pixel buffer,
we don't need an 'invalidate_mapped_buffer' counterpart to this function
called to ensure that host writes to the pixel buffer mapped memory are made visible to the device NOTE : since we guarantee that the device won ' t be writing to the pixel buffer we don ' t need an ' invalidate_mapped_buffer ' counterpart to this function
&self
logical_device
&ash::Device
&self
logical_device
&ash::Device