Struct wgpu_core::track::buffer::BufferBindGroupState
source · pub(crate) struct BufferBindGroupState {
buffers: Vec<(Arc<Buffer>, BufferUses)>,
}
Expand description
Stores a bind group’s buffers + their usages (within the bind group).
Fields§
§buffers: Vec<(Arc<Buffer>, BufferUses)>
Implementations§
source§impl BufferBindGroupState
impl BufferBindGroupState
pub fn new() -> Self
sourcepub(crate) fn optimize(&mut self)
pub(crate) fn optimize(&mut self)
Optimize the buffer 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 ascending order.
sourcepub fn used_tracker_indices(&self) -> impl Iterator<Item = TrackerIndex> + '_
pub fn used_tracker_indices(&self) -> impl Iterator<Item = TrackerIndex> + '_
Returns a list of all buffers tracked. May contain duplicates.
sourcepub fn insert_single(&mut self, buffer: Arc<Buffer>, state: BufferUses)
pub fn insert_single(&mut self, buffer: Arc<Buffer>, state: BufferUses)
Adds the given resource with the given state.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BufferBindGroupState
impl !RefUnwindSafe for BufferBindGroupState
impl Send for BufferBindGroupState
impl Sync for BufferBindGroupState
impl Unpin for BufferBindGroupState
impl !UnwindSafe for BufferBindGroupState
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