Struct wgpu_core::init_tracker::InitTracker
source · pub(crate) struct InitTracker<Idx: Ord + Copy + Default> {
uninitialized_ranges: SmallVec<[Range<Idx>; 1]>,
}
Expand description
Tracks initialization status of a linear range from 0..size
Fields§
§uninitialized_ranges: SmallVec<[Range<Idx>; 1]>
Non-overlapping list of all uninitialized ranges, sorted by range end.
Implementations§
source§impl InitTracker<BufferAddress>
impl InitTracker<BufferAddress>
sourcepub(crate) fn check_action(
&self,
action: &BufferInitTrackerAction,
) -> Option<BufferInitTrackerAction>
pub(crate) fn check_action( &self, action: &BufferInitTrackerAction, ) -> Option<BufferInitTrackerAction>
Checks if an action has/requires any effect on the initialization status and shrinks its range if possible.
sourcepub(crate) fn create_action(
&self,
buffer: &Arc<Buffer>,
query_range: Range<BufferAddress>,
kind: MemoryInitKind,
) -> Option<BufferInitTrackerAction>
pub(crate) fn create_action( &self, buffer: &Arc<Buffer>, query_range: Range<BufferAddress>, kind: MemoryInitKind, ) -> Option<BufferInitTrackerAction>
Creates an action if it would have any effect on the initialization status and shrinks the range if possible.
source§impl<Idx> InitTracker<Idx>
impl<Idx> InitTracker<Idx>
pub(crate) fn new(size: Idx) -> Self
sourcepub(crate) fn check(&self, query_range: Range<Idx>) -> Option<Range<Idx>>
pub(crate) fn check(&self, query_range: Range<Idx>) -> Option<Range<Idx>>
Checks for uninitialized ranges within a given query range.
If query_range
includes any uninitialized portions of this init
tracker’s resource, return the smallest subrange of query_range
that
covers all uninitialized regions.
The returned range may be larger than necessary, to keep this function O(log n).
pub(crate) fn uninitialized( &mut self, drain_range: Range<Idx>, ) -> UninitializedIter<'_, Idx> ⓘ
pub(crate) fn drain( &mut self, drain_range: Range<Idx>, ) -> InitTrackerDrain<'_, Idx> ⓘ
Trait Implementations§
Auto Trait Implementations§
impl<Idx> Freeze for InitTracker<Idx>where
Idx: Freeze,
impl<Idx> RefUnwindSafe for InitTracker<Idx>where
Idx: RefUnwindSafe,
impl<Idx> Send for InitTracker<Idx>where
Idx: Send,
impl<Idx> Sync for InitTracker<Idx>where
Idx: Sync,
impl<Idx> Unpin for InitTracker<Idx>where
Idx: Unpin,
impl<Idx> UnwindSafe for InitTracker<Idx>where
Idx: RefUnwindSafe + UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)