pub(crate) struct PendingWrites<A: Api> {
    pub command_encoder: A::CommandEncoder,
    pub is_active: bool,
    pub temp_resources: Vec<TempResource<A>>,
    pub dst_buffers: HashSet<BufferId, BuildHasherDefault<FxHasher>>,
    pub dst_textures: HashSet<TextureId, BuildHasherDefault<FxHasher>>,
    pub executing_command_buffers: Vec<A::CommandBuffer>,
}
Expand description

A private command encoder for writes made directly on the device or queue.

Operations like buffer_unmap, queue_write_buffer, and queue_write_texture need to copy data to the GPU. At the hal level, this must be done by encoding and submitting commands, but these operations are not associated with any specific wgpu command buffer.

Instead, Device::pending_writes owns one of these values, which has its own hal command encoder and resource lists. The commands accumulated here are automatically submitted to the queue the next time the user submits a wgpu command buffer, ahead of the user’s commands.

All uses of StagingBuffers end up here.

Fields§

§command_encoder: A::CommandEncoder§is_active: bool§temp_resources: Vec<TempResource<A>>§dst_buffers: HashSet<BufferId, BuildHasherDefault<FxHasher>>§dst_textures: HashSet<TextureId, BuildHasherDefault<FxHasher>>§executing_command_buffers: Vec<A::CommandBuffer>

Implementations§

source§

impl<A: Api> PendingWrites<A>

source

pub fn new(command_encoder: A::CommandEncoder) -> Self

source

pub fn dispose(self, device: &A::Device)

source

pub fn consume_temp(&mut self, resource: TempResource<A>)

source

fn consume(&mut self, buffer: StagingBuffer<A>)

source

fn pre_submit(&mut self) -> Option<&A::CommandBuffer>

source

fn post_submit( &mut self, command_allocator: &Mutex<CommandAllocator<A>>, device: &A::Device, queue: &A::Queue ) -> Option<EncoderInFlight<A>>

source

pub fn activate(&mut self) -> &mut A::CommandEncoder

source

pub fn deactivate(&mut self)

Trait Implementations§

source§

impl<A: Debug + Api> Debug for PendingWrites<A>where A::CommandEncoder: Debug, A::CommandBuffer: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<A> !RefUnwindSafe for PendingWrites<A>

§

impl<A> Send for PendingWrites<A>

§

impl<A> Sync for PendingWrites<A>

§

impl<A> Unpin for PendingWrites<A>where <A as Api>::Buffer: Unpin, <A as Api>::CommandBuffer: Unpin, <A as Api>::CommandEncoder: Unpin, <A as Api>::Texture: Unpin, <A as Api>::TextureView: Unpin,

§

impl<A> !UnwindSafe for PendingWrites<A>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WasmNotSend for Twhere T: Send,

source§

impl<T> WasmNotSync for Twhere T: Sync,