pub enum PollType<T> {
Wait {
submission_index: Option<T>,
timeout: Option<Duration>,
},
Poll,
}
Expand description
Passed to Device::poll
to control how and if it should block.
Variants§
Wait
On wgpu-core based backends, block until the given submission has completed execution, and any callbacks have been invoked.
On WebGPU, this has no effect. Callbacks are invoked from the window event loop.
Fields
submission_index: Option<T>
Submission index to wait for.
If not specified, will wait for the most recent submission at the time of the poll. By the time the method returns, more submissions may have taken place.
timeout: Option<Duration>
Max time to wait for the submission to complete.
If not specified, will wait indefinitely (or until an error is detected).
If waiting for the GPU device takes this long or longer, the poll will return PollError::Timeout
.
Poll
Check the device for a single time without blocking.
Implementations§
Source§impl<T> PollType<T>
impl<T> PollType<T>
Sourcepub const fn wait_indefinitely() -> Self
pub const fn wait_indefinitely() -> Self
Wait indefinitely until for the most recent submission to complete.
This is a convenience function that creates a Self::Wait
variant with
no timeout and no submission index.