struct StagingBuffer {
global: Arc<Global>,
buffer_id: BufferId,
state: StagingBufferState,
}
Expand description
A staging buffer used for texture to buffer to CPU copy operations.
Fields§
§global: Arc<Global>
§buffer_id: BufferId
§state: StagingBufferState
Implementations§
Source§impl StagingBuffer
impl StagingBuffer
fn new(global: Arc<Global>, buffer_id: BufferId) -> Self
const fn is_mapped(&self) -> bool
Sourcefn is_available_and_has_compatible_config(
&self,
config: &ContextConfiguration,
) -> bool
fn is_available_and_has_compatible_config( &self, config: &ContextConfiguration, ) -> bool
Return true if buffer can be used directly with provided config without any additional work
Sourceconst fn needs_assignment(&self) -> bool
const fn needs_assignment(&self) -> bool
Return true if buffer is not mapping or being mapped
Sourcefn ensure_available(
&mut self,
config: &ContextConfiguration,
) -> Result<(), CreateBufferError>
fn ensure_available( &mut self, config: &ContextConfiguration, ) -> Result<(), CreateBufferError>
Make buffer available by unmapping / destroying it and then recreating it if needed.
Sourcefn prepare_load_texture_command_buffer(
&mut self,
texture_id: TextureId,
encoder_id: CommandEncoderId,
config: &ContextConfiguration,
) -> Result<CommandBufferId, Box<dyn Error>>
fn prepare_load_texture_command_buffer( &mut self, texture_id: TextureId, encoder_id: CommandEncoderId, config: &ContextConfiguration, ) -> Result<CommandBufferId, Box<dyn Error>>
Makes buffer available and prepares command encoder that will copy texture to this staging buffer.
Caller must submit command buffer to queue.
Trait Implementations§
Source§impl Debug for StagingBuffer
impl Debug for StagingBuffer
Source§impl Drop for StagingBuffer
impl Drop for StagingBuffer
impl Sync for StagingBuffer
Auto Trait Implementations§
impl Freeze for StagingBuffer
impl !RefUnwindSafe for StagingBuffer
impl Send for StagingBuffer
impl Unpin for StagingBuffer
impl !UnwindSafe for StagingBuffer
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert