Skip to main content

ImportedImage

Struct ImportedImage 

Source
pub struct ImportedImage {
    pub image: Handle<Image>,
    pub view: Handle<ImageView>,
    pub format: Format,
    pub extent: (u32, u32),
    pub initial: ResourceState,
    pub claim: InitialClaim,
    pub final_state: ResourceState,
}
Expand description

An image the graph did not create, and does not own.

The swapchain image is the canonical one: it belongs to the swapchain, it arrives in an undefined layout, and it must leave in ResourceState::Present. Saying that once, here, is what removes the hand-written barriers from every frame loop in the engine.

Fields§

§image: Handle<Image>

The image itself.

§view: Handle<ImageView>

A view covering what the passes will render into or sample.

§format: Format

Texel format, which fixes the subresource aspects a barrier names.

§extent: (u32, u32)

Size in pixels, which fixes the render area of any pass that attaches it.

§initial: ResourceState

The state it is in when the graph starts.

ResourceState::Undefined for a freshly acquired swapchain image — which discards its contents, which is free, and which is the only correct source for one.

Unlike a transient, this is a declaration the owner makes, not something the graph can derive: the graph never created this image and has no description of it to look up. Undefined is right for an acquired swapchain image because the acquire’s semaphore — waited on by the submission that runs this graph — already orders the frame after everything the presentation engine and the previous frame did with it, so the barrier has no ordering left to carry and only has to reach the layout. An importer with no such semaphore in the chain owes the graph the truth here instead, or it is asking for the same write-after-write the module docs describe.

claim says which of those two an importer is, and a InitialClaim::Tracked one is checked rather than taken on trust.

§claim: InitialClaim

How the importer knows initial, and so whether the graph checks it. See InitialClaim.

§final_state: ResourceState

The state the graph must leave it in.

ResourceState::Present for a swapchain image. The graph emits a trailing barrier if the last pass left it somewhere else, and emits nothing if it did not — so this is what the image is in once the frame has run either way, which is exactly why it is what the ledger behind InitialClaim::Tracked records.

Trait Implementations§

Source§

impl Clone for ImportedImage

Source§

fn clone(&self) -> ImportedImage

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ImportedImage

Source§

impl Debug for ImportedImage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for ImportedImage

Source§

impl PartialEq for ImportedImage

Source§

fn eq(&self, other: &ImportedImage) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ImportedImage

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

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> HalThreadSafe for T
where T: Send + Sync,

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.