Struct Tracker

Source
pub(crate) struct Tracker {
    pub buffers: BufferTracker,
    pub textures: TextureTracker,
    pub blas_s: BlasTracker,
    pub tlas_s: StatelessTracker<Tlas>,
    pub views: StatelessTracker<TextureView>,
    pub bind_groups: StatelessTracker<BindGroup>,
    pub compute_pipelines: StatelessTracker<ComputePipeline>,
    pub render_pipelines: StatelessTracker<RenderPipeline>,
    pub bundles: StatelessTracker<RenderBundle>,
    pub query_sets: StatelessTracker<QuerySet>,
}
Expand description

A full double sided tracker used by CommandBuffers.

Fields§

§buffers: BufferTracker

Buffers used within this command buffer.

For compute passes, this only includes buffers actually used by the pipeline (contrast with the bind_groups member).

§textures: TextureTracker

Textures used within this command buffer.

For compute passes, this only includes textures actually used by the pipeline (contrast with the bind_groups member).

§blas_s: BlasTracker§tlas_s: StatelessTracker<Tlas>§views: StatelessTracker<TextureView>§bind_groups: StatelessTracker<BindGroup>

Contains all bind groups that were passed in any call to set_bind_group on the encoder.

WebGPU requires that submission fails if any resource in any of these bind groups is destroyed, even if the resource is not actually used by the pipeline (e.g. because the pipeline does not use the bound slot, or because the bind group was replaced by a subsequent call to set_bind_group).

§compute_pipelines: StatelessTracker<ComputePipeline>§render_pipelines: StatelessTracker<RenderPipeline>§bundles: StatelessTracker<RenderBundle>§query_sets: StatelessTracker<QuerySet>

Implementations§

Source§

impl Tracker

Source

pub fn new() -> Self

Source

pub fn set_from_bind_group( &mut self, scope: &mut UsageScope<'_>, bind_group: &BindGroupStates, )

Iterates through all resources in the given bind group and adopts the state given for those resources in the UsageScope.

If a transition is needed to get the resources into the needed state, those transitions are stored within the tracker. A subsequent call to BufferTracker::drain_transitions or TextureTracker::drain_transitions is needed to get those transitions.

This is a really funky method used by Compute Passes to generate barriers for each dispatch. We use the bind group as a source of which IDs to look at.

Only stateful things are merged in here, all other resources are owned indirectly by the bind group.

§Panics

If a resource in the bind_group is not found in the usage scope.

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
§

impl<T> Downcast<T> for T

§

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.
§

impl<T> Upcast<T> for T

§

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

Source§

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

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,