Struct wgpu_core::track::UsageScope
source · pub(crate) struct UsageScope<A: HalApi> {
pub buffers: BufferUsageScope<A>,
pub textures: TextureUsageScope<A>,
}
Expand description
A usage scope tracker. Only needs to store stateful resources as stateless resources cannot possibly have a usage conflict.
Fields§
§buffers: BufferUsageScope<A>
§textures: TextureUsageScope<A>
Implementations§
source§impl<A: HalApi> UsageScope<A>
impl<A: HalApi> UsageScope<A>
sourcepub fn new(
buffers: &Storage<Buffer<A>, BufferId>,
textures: &Storage<Texture<A>, TextureId>
) -> Self
pub fn new( buffers: &Storage<Buffer<A>, BufferId>, textures: &Storage<Texture<A>, TextureId> ) -> Self
Create the render bundle scope and pull the maximum IDs from the hubs.
sourcepub unsafe fn merge_bind_group(
&mut self,
textures: &Storage<Texture<A>, TextureId>,
bind_group: &BindGroupStates<A>
) -> Result<(), UsageConflict>
pub unsafe fn merge_bind_group( &mut self, textures: &Storage<Texture<A>, TextureId>, bind_group: &BindGroupStates<A> ) -> Result<(), UsageConflict>
Merge the inner contents of a bind group into 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
length of the storage given at the call to new
.
sourcepub unsafe fn merge_render_bundle(
&mut self,
textures: &Storage<Texture<A>, TextureId>,
render_bundle: &RenderBundleScope<A>
) -> Result<(), UsageConflict>
pub unsafe fn merge_render_bundle( &mut self, textures: &Storage<Texture<A>, TextureId>, render_bundle: &RenderBundleScope<A> ) -> Result<(), UsageConflict>
Merge the inner contents of a bind group into the usage scope.
Only stateful things are merged in here, all other resources are owned indirectly by a bind group or are merged directly into the command buffer tracker.
Safety
The maximum ID given by each bind group resource must be less than the
length of the storage given at the call to new
.