Struct wgpu_core::track::texture::TextureBindGroupState
source · pub(crate) struct TextureBindGroupState<A: HalApi> {
textures: Vec<(Valid<TextureId>, Option<TextureSelector>, RefCount, TextureUses)>,
_phantom: PhantomData<A>,
}
Expand description
Stores all the textures that a bind group stores.
Fields§
§textures: Vec<(Valid<TextureId>, Option<TextureSelector>, RefCount, TextureUses)>
§_phantom: PhantomData<A>
Implementations§
source§impl<A: HalApi> TextureBindGroupState<A>
impl<A: HalApi> TextureBindGroupState<A>
pub fn new() -> Self
sourcepub(crate) fn optimize(&mut self)
pub(crate) fn optimize(&mut self)
Optimize the texture bind group state by sorting it by ID.
When this list of states is merged into a tracker, the memory accesses will be in a constant assending order.
sourcepub fn used(&self) -> impl Iterator<Item = Valid<TextureId>> + '_
pub fn used(&self) -> impl Iterator<Item = Valid<TextureId>> + '_
Returns a list of all buffers tracked. May contain duplicates.
sourcepub fn add_single<'a>(
&mut self,
storage: &'a Storage<Texture<A>, TextureId>,
id: TextureId,
ref_count: RefCount,
selector: Option<TextureSelector>,
state: TextureUses
) -> Option<&'a Texture<A>>
pub fn add_single<'a>( &mut self, storage: &'a Storage<Texture<A>, TextureId>, id: TextureId, ref_count: RefCount, selector: Option<TextureSelector>, state: TextureUses ) -> Option<&'a Texture<A>>
Adds the given resource with the given state.
Auto Trait Implementations§
impl<A> !RefUnwindSafe for TextureBindGroupState<A>
impl<A> Send for TextureBindGroupState<A>where A: Send,
impl<A> Sync for TextureBindGroupState<A>where A: Sync,
impl<A> Unpin for TextureBindGroupState<A>where A: Unpin,
impl<A> !UnwindSafe for TextureBindGroupState<A>
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