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
impl Tracker
pub fn new() -> Self
sourcepub unsafe fn set_and_remove_from_usage_scope_sparse(
&mut self,
scope: &mut UsageScope<'_>,
bind_group: &BindGroupStates,
)
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