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: BufferTrackerBuffers used within this command buffer.
For compute passes, this only includes buffers actually used by the
pipeline (contrast with the bind_groups member).
textures: TextureTrackerTextures 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
impl Tracker
pub fn new() -> Self
Sourcepub fn set_from_bind_group(
&mut self,
scope: &mut UsageScope<'_>,
bind_group: &BindGroupStates,
)
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.