pub(crate) struct Tracker<A: HalApi> {
pub buffers: BufferTracker<A>,
pub textures: TextureTracker<A>,
pub views: StatelessTracker<A, TextureView<A>, TextureViewId>,
pub samplers: StatelessTracker<A, Sampler<A>, SamplerId>,
pub bind_groups: StatelessTracker<A, BindGroup<A>, BindGroupId>,
pub compute_pipelines: StatelessTracker<A, ComputePipeline<A>, ComputePipelineId>,
pub render_pipelines: StatelessTracker<A, RenderPipeline<A>, RenderPipelineId>,
pub bundles: StatelessTracker<A, RenderBundle<A>, RenderBundleId>,
pub query_sets: StatelessTracker<A, QuerySet<A>, QuerySetId>,
}
Expand description
A full double sided tracker used by CommandBuffers and the Device.
Fields§
§buffers: BufferTracker<A>
§textures: TextureTracker<A>
§views: StatelessTracker<A, TextureView<A>, TextureViewId>
§samplers: StatelessTracker<A, Sampler<A>, SamplerId>
§bind_groups: StatelessTracker<A, BindGroup<A>, BindGroupId>
§compute_pipelines: StatelessTracker<A, ComputePipeline<A>, ComputePipelineId>
§render_pipelines: StatelessTracker<A, RenderPipeline<A>, RenderPipelineId>
§bundles: StatelessTracker<A, RenderBundle<A>, RenderBundleId>
§query_sets: StatelessTracker<A, QuerySet<A>, QuerySetId>
Implementations§
source§impl<A: HalApi> Tracker<A>
impl<A: HalApi> Tracker<A>
pub fn new() -> Self
sourcepub fn set_size(
&mut self,
buffers: Option<&Storage<Buffer<A>, BufferId>>,
textures: Option<&Storage<Texture<A>, TextureId>>,
views: Option<&Storage<TextureView<A>, TextureViewId>>,
samplers: Option<&Storage<Sampler<A>, SamplerId>>,
bind_groups: Option<&Storage<BindGroup<A>, BindGroupId>>,
compute_pipelines: Option<&Storage<ComputePipeline<A>, ComputePipelineId>>,
render_pipelines: Option<&Storage<RenderPipeline<A>, RenderPipelineId>>,
bundles: Option<&Storage<RenderBundle<A>, RenderBundleId>>,
query_sets: Option<&Storage<QuerySet<A>, QuerySetId>>
)
pub fn set_size( &mut self, buffers: Option<&Storage<Buffer<A>, BufferId>>, textures: Option<&Storage<Texture<A>, TextureId>>, views: Option<&Storage<TextureView<A>, TextureViewId>>, samplers: Option<&Storage<Sampler<A>, SamplerId>>, bind_groups: Option<&Storage<BindGroup<A>, BindGroupId>>, compute_pipelines: Option<&Storage<ComputePipeline<A>, ComputePipelineId>>, render_pipelines: Option<&Storage<RenderPipeline<A>, RenderPipelineId>>, bundles: Option<&Storage<RenderBundle<A>, RenderBundleId>>, query_sets: Option<&Storage<QuerySet<A>, QuerySetId>> )
Pull the maximum IDs from the hubs.
sourcepub unsafe fn set_and_remove_from_usage_scope_sparse(
&mut self,
textures: &Storage<Texture<A>, TextureId>,
scope: &mut UsageScope<A>,
bind_group: &BindGroupStates<A>
)
pub unsafe fn set_and_remove_from_usage_scope_sparse( &mut self, textures: &Storage<Texture<A>, TextureId>, scope: &mut UsageScope<A>, bind_group: &BindGroupStates<A> )
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
or
TextureTracker::drain
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 here, all 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
sourcepub unsafe fn add_from_render_bundle(
&mut self,
render_bundle: &RenderBundleScope<A>
) -> Result<(), UsageConflict>
pub unsafe fn add_from_render_bundle( &mut self, render_bundle: &RenderBundleScope<A> ) -> Result<(), UsageConflict>
Tracks the stateless resources from the given renderbundle. It is expected that the stateful resources will get merged into a usage scope first.
Safety
The maximum ID given by each bind group resource must be less than the
value given to set_size