fn unmap_memory(&self) {
        let mut buffer_state = self.buffer_state.lock();
        match *buffer_state {
            BufferState::Mapped(_) => {
                self.device.allocator.unmap_memory(&self.allocation);
                *buffer_state = BufferState::Unmapped;
            }
            BufferState::Unmapped => {}
        }
    }
/// TODO: We should disconnect the buffer state from the actual memory mapping
///       so that the buffer can stay permanently mapped whenever it's created
///       with MAP_READ or MAP_WRITE. The buffer state will then become a user
///       only state to prevent modification while the buffer is in use.
We should disconnect the buffer state from the actual memory mapping
so that the buffer can stay permanently mapped whenever it's created
with MAP_READ or MAP_WRITE. The buffer state will then become a user
only state to prevent modification while the buffer is in use.
We should disconnect the buffer state from the actual memory mapping so that the buffer can stay permanently mapped whenever it ' s created with MAP_READ or MAP_WRITE . The buffer state will then become a user only state to prevent modification while the buffer is in use .
fn unmap_memory(&self) {
        let mut buffer_state = self.buffer_state.lock();
        match *buffer_state {
            BufferState::Mapped(_) => {
                self.device.allocator.unmap_memory(&self.allocation);
                *buffer_state = BufferState::Unmapped;
            }
            BufferState::Unmapped => {}
        }
    }
fn unmap_memory ( & self ) { let mut buffer_state = self . buffer_state . lock ( ) ; match * buffer_state { BufferState :: Mapped ( _ ) => { self . device . allocator . unmap_memory ( & self . allocation ) ; * buffer_state = BufferState :: Unmapped ; } BufferState :: Unmapped => { } } }
TODO: We should disconnect the buffer state from the actual memory mapping
so that the buffer can stay permanently mapped whenever it's created
with MAP_READ or MAP_WRITE.
TODO : We should disconnect the buffer state from the actual memory mapping so that the buffer can stay permanently mapped whenever it ' s created with MAP_READ or MAP_WRITE .
&self
&self