pub struct ExternalTextures<V = TextureView> { /* private fields */ }Expand description
Every externally owned texture currently bound, keyed by the
SceneTextureId its owner minted.
The stored view must be a non-array 2D view of a float-sampleable texture
whose texture carries wgpu::TextureUsages::TEXTURE_BINDING; only mip level
0 is ever read. wgpu rejects anything else when the bind group is built,
which is the frame the mistake surfaces on.
Generic over the view type (default wgpu::TextureView, the real engine’s)
so the map’s own insert/replace/remove behaviour is testable without a
device.
Implementations§
Source§impl<V> ExternalTextures<V>
impl<V> ExternalTextures<V>
Sourcepub fn bind(&mut self, id: SceneTextureId, view: V) -> Option<V>
pub fn bind(&mut self, id: SceneTextureId, view: V) -> Option<V>
Registers view under id, returning whatever was registered before.
Sourcepub fn unbind(&mut self, id: SceneTextureId) -> Option<V>
pub fn unbind(&mut self, id: SceneTextureId) -> Option<V>
Removes and returns the view registered under id.
Sourcepub fn get(&self, id: SceneTextureId) -> Option<&V>
pub fn get(&self, id: SceneTextureId) -> Option<&V>
The view registered under id.
Trait Implementations§
Source§impl<V: Debug> Debug for ExternalTextures<V>
impl<V: Debug> Debug for ExternalTextures<V>
Auto Trait Implementations§
impl<V> Freeze for ExternalTextures<V>
impl<V> RefUnwindSafe for ExternalTextures<V>
impl<V> Send for ExternalTextures<V>
impl<V> Sync for ExternalTextures<V>
impl<V> Unpin for ExternalTextures<V>
impl<V> UnsafeUnpin for ExternalTextures<V>
impl<V> UnwindSafe for ExternalTextures<V>
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