logo

Struct wgpu::Queue

source · []
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

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.

Schedule a data write into buffer starting at offset via the returned QueueWriteBufferView.

The returned value can be dereferenced to a &mut [u8]; dereferencing it to a &[u8] panics!

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 size is greater than the size of buffer starting at offset.

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.

Submits a series of finished command buffers for execution.

Gets the amount of nanoseconds each tick of a timestamp query represents.

Returns zero if timestamp queries are unsupported.

Registers a callback when the previous call to submit finishes running on the gpu. This callback being called implies that all mapped buffer callbacks attached to the same submission have also been called.

For the callback to complete, either queue.submit(..), instance.poll_all(..), or device.poll(..) must be called elsewhere in the runtime, possibly integrated into an event loop or run on a separate thread.

The callback will be called on the thread that first calls the above functions after the gpu work has completed. There are no restrictions on the code you can run in the callback, however on native the call to the function will not complete until the callback returns, so prefer keeping callbacks short and used to set flags, send messages, etc.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.