Struct wgpu_core::device::life::ActiveSubmission

source ·
struct ActiveSubmission {
    index: SubmissionIndex,
    temp_resources: Vec<TempResource>,
    mapped: Vec<Arc<Buffer>>,
    encoders: Vec<EncoderInFlight>,
    work_done_closures: SmallVec<[SubmittedWorkDoneClosure; 1]>,
}
Expand description

A command submitted to the GPU for execution.

§Keeping resources alive while the GPU is using them

wgpu_hal requires that, when a command is submitted to a queue, all the resources it uses must remain alive until it has finished executing.

Fields§

§index: SubmissionIndex

The index of the submission we track.

When Device::fence’s value is greater than or equal to this, our queue submission has completed.

§temp_resources: Vec<TempResource>

Temporary resources to be freed once this queue submission has completed.

§mapped: Vec<Arc<Buffer>>

Buffers to be mapped once this submission has completed.

§encoders: Vec<EncoderInFlight>

Command buffers used by this submission, and the encoder that owns them.

wgpu_hal::Queue::submit requires the submitted command buffers to remain alive until the submission has completed execution. Command encoders double as allocation pools for command buffers, so holding them here and cleaning them up in LifetimeTracker::triage_submissions satisfies that requirement.

Once this submission has completed, the command buffers are reset and the command encoder is recycled.

§work_done_closures: SmallVec<[SubmittedWorkDoneClosure; 1]>

List of queue “on_submitted_work_done” closures to be called once this submission has completed.

Implementations§

source§

impl ActiveSubmission

source

pub fn contains_buffer(&self, buffer: &Buffer) -> bool

Returns true if this submission contains the given buffer.

This only uses constant-time operations.

source

pub fn contains_texture(&self, texture: &Texture) -> bool

Returns true if this submission contains the given texture.

This only uses constant-time operations.

source

pub fn contains_blas(&self, blas: &Blas) -> bool

source

pub fn contains_tlas(&self, tlas: &Tlas) -> bool

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast<T> for T

source§

fn downcast(&self) -> &T

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Upcast<T> for T

source§

fn upcast(&self) -> Option<&T>

source§

impl<T> WasmNotSend for T
where T: Send,