CommandBufferTextureMemoryActions

Struct CommandBufferTextureMemoryActions 

Source
pub(crate) struct CommandBufferTextureMemoryActions {
    init_actions: Vec<TextureInitTrackerAction>,
    discards: Vec<TextureSurfaceDiscard>,
}

Fields§

§init_actions: Vec<TextureInitTrackerAction>

The tracker actions that we need to be executed before the command buffer is executed.

§discards: Vec<TextureSurfaceDiscard>

Tracks surfaces that were previously discarded within this command buffer.

If a later pass reads from one of these surfaces, we must insert an immediate clear operation in the command sequence. (Typically, memory initialization is done in a dedicated pass prepended to the entire command buffer, but the discards we are tracking here occur after that). Any discarded surfaces that are not reinitialized prior to the end of the command buffer, will have their initialization_status set to uninitialized at that point, except for depth slices, which must be reinitialized prior to the end of the command buffer.

We do a linear scan of the discarded surface list for each initialization action, i.e., we assume that most of the time there are no discarded surfaces. If this list has more than a few items, performance will suffer.

Implementations§

Source§

impl CommandBufferTextureMemoryActions

Source

pub(crate) fn drain_init_actions( &mut self, ) -> Drain<'_, TextureInitTrackerAction>

Source

pub(crate) fn discard(&mut self, discard: TextureSurfaceDiscard)

Source

pub(crate) fn register_init_action( &mut self, action: &TextureInitTrackerAction, depth_slices: Option<Range<u32>>, ) -> Vec<TextureSurfaceDiscard>

Registers a TextureInitTrackerAction.

Returns previously discarded surfaces that need to be initialized immediately. Only returns a non-empty list if action.kind is MemoryInitKind::NeedsInitializedMemory. These surfaces are removed from the pending discard list, so the caller takes on the obligation to clear them (via fixup_discarded_surfaces).

depth_slices is the range of depth slices that action physically accesses, or None if the access is to all slices of a 3D texture or to some other texture type. The depth slice information does not flow to the global init tracker, whose granularity is a whole mip level, but it is important in deciding which pending discards have to be repaired ahead of this action, as opposed to at the end of the command buffer.

Source

pub(crate) fn register_implicit_init( &mut self, texture: &Arc<Texture>, range: TextureInitRange, )

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,