[−][src]Struct wgpu_conveyor::BindGroupCache
Bind group cache. Corresponds to a single bind group.
If you use multiple bind groups in a single cache, you will likely have cache misses constantly.
Implementations
impl<Key: Hash + Eq + Clone> BindGroupCache<Key>
[src]
#[must_use]pub fn new() -> Self
[src]
Create a bind group cache with default size 4.
#[must_use]pub fn with_capacity(size: usize) -> Self
[src]
Create a bind group cache with given size.
pub fn clear(&mut self)
[src]
Empty cache to force repopulation
pub fn create_bind_group<'a, Set, BindGroupFn>(
&mut self,
buffers: Set,
use_cache: bool,
bind_group_fn: BindGroupFn
) -> Key where
Set: AutomatedBufferSet<'a, Key = Key>,
BindGroupFn: FnOnce(&Set::Value) -> BindGroup,
[src]
&mut self,
buffers: Set,
use_cache: bool,
bind_group_fn: BindGroupFn
) -> Key where
Set: AutomatedBufferSet<'a, Key = Key>,
BindGroupFn: FnOnce(&Set::Value) -> BindGroup,
Using the set of AutomatedBuffer
s provided
in buffers
, create or retrieve a bind group and return the key
to call get
with.
If a bind group is not found, bind_group_fn
will be called with
the resolved BeltBufferId
for the given buffers.
This result will then be cached.
use_cache
, if false, will always call the function and overwrite
the value (if any) in the cache. This is useful if bind groups
are changing every invocation.
pub fn get(&self, key: &Key) -> Option<&BindGroup>
[src]
Trait Implementations
Auto Trait Implementations
impl<Key> !RefUnwindSafe for BindGroupCache<Key>
impl<Key> Send for BindGroupCache<Key> where
Key: Send,
Key: Send,
impl<Key> Sync for BindGroupCache<Key> where
Key: Sync,
Key: Sync,
impl<Key> Unpin for BindGroupCache<Key>
impl<Key> !UnwindSafe for BindGroupCache<Key>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,