Struct wgpu_core::device::queue::PendingWrites
source · pub(crate) struct PendingWrites {
pub command_encoder: Box<dyn DynCommandEncoder>,
pub is_recording: bool,
temp_resources: Vec<TempResource>,
dst_buffers: HashMap<TrackerIndex, Arc<Buffer>, BuildHasherDefault<FxHasher>>,
dst_textures: HashMap<TrackerIndex, Arc<Texture>, BuildHasherDefault<FxHasher>>,
}
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.
Important: When locking pending_writes be sure that tracker is not locked and try to lock trackers for the minimum timespan possible
All uses of StagingBuffer
s end up here.
Fields§
§command_encoder: Box<dyn DynCommandEncoder>
§is_recording: bool
True if command_encoder
is in the “recording” state, as
described in the docs for the wgpu_hal::CommandEncoder
trait.
temp_resources: Vec<TempResource>
§dst_buffers: HashMap<TrackerIndex, Arc<Buffer>, BuildHasherDefault<FxHasher>>
§dst_textures: HashMap<TrackerIndex, Arc<Texture>, BuildHasherDefault<FxHasher>>