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
impl CommandBufferTextureMemoryActions
pub(crate) fn drain_init_actions( &mut self, ) -> Drain<'_, TextureInitTrackerAction>
pub(crate) fn discard(&mut self, discard: TextureSurfaceDiscard)
Sourcepub(crate) fn register_init_action(
&mut self,
action: &TextureInitTrackerAction,
depth_slices: Option<Range<u32>>,
) -> Vec<TextureSurfaceDiscard>
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.
pub(crate) fn register_implicit_init( &mut self, texture: &Arc<Texture>, range: TextureInitRange, )
Trait Implementations§
Source§impl Default for CommandBufferTextureMemoryActions
impl Default for CommandBufferTextureMemoryActions
Source§fn default() -> CommandBufferTextureMemoryActions
fn default() -> CommandBufferTextureMemoryActions
Auto Trait Implementations§
impl Freeze for CommandBufferTextureMemoryActions
impl !RefUnwindSafe for CommandBufferTextureMemoryActions
impl Send for CommandBufferTextureMemoryActions
impl Sync for CommandBufferTextureMemoryActions
impl Unpin for CommandBufferTextureMemoryActions
impl !UnwindSafe for CommandBufferTextureMemoryActions
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
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>
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>
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