Skip to main content

Transient

Struct Transient 

Source
pub struct Transient<H>
where H: Hal,
{ pub layers: Vec<<H as Hal>::Texture>, pub ramps: Vec<<H as Hal>::Texture>, }
Expand description

The textures a recording needs that it did not arrive with.

Layer targets are rendered and baked gradients are uploaded, both per submission and both released with it. Grouped because they are the same thing from the caller’s side – resources this frame owns and must destroy after the work that reads them – and because a caller that has to submit the root pass itself would otherwise be handed two lists and trusted to keep them together.

Fields§

§layers: Vec<<H as Hal>::Texture>

One per non-root pass, in pass order.

§ramps: Vec<<H as Hal>::Texture>

One per entry in Recording::ramps, in that order.

Implementations§

Source§

impl<H> Transient<H>
where H: Hal,

Source

pub fn into_textures(self) -> Vec<<H as Hal>::Texture>

Everything this frame owns, as one list to release when it is done.

For a caller that keeps the resources alive past this call – a presentation target holding them until its fence signals – where a texture came from stops mattering the moment the submission is made. What remains is when it is safe to free, and that answer is the same for all of them.

Source

pub fn destroy(self, ctx: &mut <H as Hal>::Context)
where <H as Hal>::Context: HalContext<Hal = H>,

Release everything, in any order: nothing here refers to anything else.

Auto Trait Implementations§

§

impl<H> Freeze for Transient<H>
where Vec<<H as Hal>::Texture>: Freeze,

§

impl<H> RefUnwindSafe for Transient<H>
where Vec<<H as Hal>::Texture>: RefUnwindSafe,

§

impl<H> Send for Transient<H>
where Vec<<H as Hal>::Texture>: Send,

§

impl<H> Sync for Transient<H>
where Vec<<H as Hal>::Texture>: Sync,

§

impl<H> Unpin for Transient<H>
where Vec<<H as Hal>::Texture>: Unpin,

§

impl<H> UnsafeUnpin for Transient<H>
where Vec<<H as Hal>::Texture>: UnsafeUnpin,

§

impl<H> UnwindSafe for Transient<H>
where Vec<<H as Hal>::Texture>: UnwindSafe,

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

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

Source§

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

Source§

impl<T> Downcast<T> for T

Source§

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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

impl<T> Upcast<T> for T

Source§

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