Struct wgpu_core::track::Tracker

source ·
pub(crate) struct Tracker {
    pub buffers: BufferTracker,
    pub textures: TextureTracker,
    pub blas_s: AccelerationStructureTracker<Blas>,
    pub tlas_s: AccelerationStructureTracker<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§textures: TextureTracker§blas_s: AccelerationStructureTracker<Blas>§tlas_s: AccelerationStructureTracker<Tlas>§views: StatelessTracker<TextureView>§bind_groups: StatelessTracker<BindGroup>§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 unsafe fn set_and_remove_from_usage_scope_sparse( &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. It also removes all touched resources from the usage scope.

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 after a call to dispatch without needing to iterate over all elements in the usage scope. We use each the bind group as a source of which IDs to look at. The bind groups must have first been added to the usage scope.

Only stateful things are merged in herell other resources are owned indirectly by the bind group.

§Safety

The maximum ID given by each bind group resource must be less than the value given to set_size

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,

source§

impl<T> WasmNotSendSync for T

source§

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