pub(crate) struct DeviceTextureTracker {
current_state_set: TextureStateSet,
metadata: ResourceMetadata<Weak<Texture>>,
temp: Vec<PendingTransition<TextureUses>>,
}Expand description
Stores all texture state within a device.
Fields§
§current_state_set: TextureStateSet§metadata: ResourceMetadata<Weak<Texture>>§temp: Vec<PendingTransition<TextureUses>>Implementations§
Source§impl DeviceTextureTracker
impl DeviceTextureTracker
pub fn new() -> Self
fn tracker_assert_in_bounds(&self, index: usize)
Sourcefn allow_index(&mut self, index: usize)
fn allow_index(&mut self, index: usize)
Extend the vectors to let the given index be valid.
Sourcepub fn used_resources(&self) -> impl Iterator<Item = &Weak<Texture>> + '_
pub fn used_resources(&self) -> impl Iterator<Item = &Weak<Texture>> + '_
Returns a list of all textures tracked.
Sourcepub fn insert_single(&mut self, texture: &Arc<Texture>, usage: TextureUses)
pub fn insert_single(&mut self, texture: &Arc<Texture>, usage: TextureUses)
Inserts a single texture and a state into the resource tracker.
If the resource already exists in the tracker, it will be overwritten.
Sourcepub fn set_single(
&mut self,
texture: &Arc<Texture>,
selector: TextureSelector,
new_state: TextureUses,
) -> Drain<'_, PendingTransition<TextureUses>>
pub fn set_single( &mut self, texture: &Arc<Texture>, selector: TextureSelector, new_state: TextureUses, ) -> Drain<'_, PendingTransition<TextureUses>>
Sets the state of a single texture.
If a transition is needed to get the texture into the given state, that transition is returned.
Sourcepub fn set_from_tracker_and_drain_transitions<'a, 'b: 'a>(
&'a mut self,
tracker: &'a TextureTracker,
snatch_guard: &'b SnatchGuard<'b>,
) -> impl Iterator<Item = TextureBarrier<'a, dyn DynTexture>>
pub fn set_from_tracker_and_drain_transitions<'a, 'b: 'a>( &'a mut self, tracker: &'a TextureTracker, snatch_guard: &'b SnatchGuard<'b>, ) -> impl Iterator<Item = TextureBarrier<'a, dyn DynTexture>>
Sets the given state for all texture in the given tracker.
If a transition is needed to get the texture into the needed state, those transitions are returned.
Sourcepub fn set_from_usage_scope_and_drain_transitions<'a, 'b: 'a>(
&'a mut self,
scope: &'a TextureUsageScope,
snatch_guard: &'b SnatchGuard<'b>,
) -> impl Iterator<Item = TextureBarrier<'a, dyn DynTexture>>
pub fn set_from_usage_scope_and_drain_transitions<'a, 'b: 'a>( &'a mut self, scope: &'a TextureUsageScope, snatch_guard: &'b SnatchGuard<'b>, ) -> impl Iterator<Item = TextureBarrier<'a, dyn DynTexture>>
Sets the given state for all textures in the given UsageScope.
If a transition is needed to get the textures into the needed state, those transitions are returned.
Trait Implementations§
Source§impl TextureTrackerSetSingle for DeviceTextureTracker
impl TextureTrackerSetSingle for DeviceTextureTracker
fn set_single( &mut self, texture: &Arc<Texture>, selector: TextureSelector, new_state: TextureUses, ) -> Drain<'_, PendingTransition<TextureUses>>
Auto Trait Implementations§
impl Freeze for DeviceTextureTracker
impl !RefUnwindSafe for DeviceTextureTracker
impl Send for DeviceTextureTracker
impl Sync for DeviceTextureTracker
impl Unpin for DeviceTextureTracker
impl UnsafeUnpin for DeviceTextureTracker
impl !UnwindSafe for DeviceTextureTracker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more