Struct wgpu_core::device::queue::PendingWrites
source · 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 StagingBuffer
s 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>
impl<A: Api> PendingWrites<A>
pub fn new(command_encoder: A::CommandEncoder) -> Self
pub fn dispose(self, device: &A::Device)
pub fn consume_temp(&mut self, resource: TempResource<A>)
fn consume(&mut self, buffer: StagingBuffer<A>)
fn pre_submit(&mut self) -> Option<&A::CommandBuffer>
fn post_submit( &mut self, command_allocator: &Mutex<CommandAllocator<A>>, device: &A::Device, queue: &A::Queue ) -> Option<EncoderInFlight<A>>
pub fn activate(&mut self) -> &mut A::CommandEncoder
pub fn deactivate(&mut self)
Trait Implementations§
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> 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