pub struct Queue { /* private fields */ }
Expand description
Handle to a command queue on a device.
A Queue
executes recorded CommandBuffer
objects and provides convenience methods
for writing to buffers and textures.
It can be created along with a Device
by calling Adapter::request_device
.
Corresponds to WebGPU GPUQueue
.
Implementations
sourceimpl Queue
impl Queue
sourcepub fn write_buffer(&self, buffer: &Buffer, offset: BufferAddress, data: &[u8])
pub fn write_buffer(&self, buffer: &Buffer, offset: BufferAddress, data: &[u8])
Schedule a data write into buffer
starting at offset
.
This method is intended to have low performance costs.
As such, the write is not immediately submitted, and instead enqueued
internally to happen at the start of the next submit()
call.
This method fails if data
overruns the size of buffer
starting at offset
.
sourcepub fn write_texture(
&self,
texture: ImageCopyTexture<'_>,
data: &[u8],
data_layout: ImageDataLayout,
size: Extent3d
)
pub fn write_texture(
&self,
texture: ImageCopyTexture<'_>,
data: &[u8],
data_layout: ImageDataLayout,
size: Extent3d
)
Schedule a data write into texture
.
This method is intended to have low performance costs.
As such, the write is not immediately submitted, and instead enqueued
internally to happen at the start of the next submit()
call.
This method fails if data
overruns the size of fragment of texture
specified with size
.
sourcepub fn submit<I: IntoIterator<Item = CommandBuffer>>(&self, command_buffers: I)
pub fn submit<I: IntoIterator<Item = CommandBuffer>>(&self, command_buffers: I)
Submits a series of finished command buffers for execution.
sourcepub fn get_timestamp_period(&self) -> f32
pub fn get_timestamp_period(&self) -> f32
Gets the amount of nanoseconds each tick of a timestamp query represents.
Returns zero if timestamp queries are unsupported.
sourcepub fn on_submitted_work_done(&self) -> impl Future<Output = ()> + Send
pub fn on_submitted_work_done(&self) -> impl Future<Output = ()> + Send
Returns a future that resolves once all the work submitted by this point is done processing on GPU.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Queue
impl Send for Queue
impl Sync for Queue
impl Unpin for Queue
impl !UnwindSafe for Queue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more