pub struct MappedRange {
pub buffer: BufferHandle,
pub offset: usize,
pub length: usize,
/* private fields */
}Expand description
Represents a mapped sub-range of a buffer for CPU write access. The mapping must be flushed and unmapped before the GPU can read.
Fields§
§buffer: BufferHandleBuffer that is mapped.
offset: usizeByte offset into the buffer.
length: usizeLength in bytes of the mapped region.
Implementations§
Source§impl MappedRange
impl MappedRange
Sourcepub fn map_write(
gl: &Context,
buffer: BufferHandle,
offset: usize,
length: usize,
) -> Self
pub fn map_write( gl: &Context, buffer: BufferHandle, offset: usize, length: usize, ) -> Self
Map a range of a buffer for writing.
Sourcepub fn map_read(
gl: &Context,
buffer: BufferHandle,
offset: usize,
length: usize,
) -> Self
pub fn map_read( gl: &Context, buffer: BufferHandle, offset: usize, length: usize, ) -> Self
Map a range for reading.
Sourcepub fn flush(&mut self, gl: &Context)
pub fn flush(&mut self, gl: &Context)
Flush the mapped range (call before unmap to ensure GPU sees writes).
Sourcepub fn is_flushed(&self) -> bool
pub fn is_flushed(&self) -> bool
Whether flush has been called.
Auto Trait Implementations§
impl Freeze for MappedRange
impl RefUnwindSafe for MappedRange
impl Send for MappedRange
impl Sync for MappedRange
impl Unpin for MappedRange
impl UnsafeUnpin for MappedRange
impl UnwindSafe for MappedRange
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.