pub struct BarrierOptimizer;Expand description
Optimises a sequence of resource barriers by removing redundant ones.
Two barriers are redundant when a later barrier subsumes an earlier one
(same src_stage → dst_stage pair for the same resource).
Implementations§
Source§impl BarrierOptimizer
impl BarrierOptimizer
Sourcepub fn optimize(barriers: &[ResourceBarrier]) -> BarrierSet
pub fn optimize(barriers: &[ResourceBarrier]) -> BarrierSet
Deduplicate barriers: for each (src, dst, resource) triple,
keep only the last occurrence. Returns the optimised set.
Sourcepub fn savings(barriers: &[ResourceBarrier]) -> usize
pub fn savings(barriers: &[ResourceBarrier]) -> usize
Count how many barriers would be removed from before to produce
the optimised set.
Trait Implementations§
Source§impl Debug for BarrierOptimizer
impl Debug for BarrierOptimizer
Source§impl Default for BarrierOptimizer
impl Default for BarrierOptimizer
Source§fn default() -> BarrierOptimizer
fn default() -> BarrierOptimizer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BarrierOptimizer
impl RefUnwindSafe for BarrierOptimizer
impl Send for BarrierOptimizer
impl Sync for BarrierOptimizer
impl Unpin for BarrierOptimizer
impl UnsafeUnpin for BarrierOptimizer
impl UnwindSafe for BarrierOptimizer
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more