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: FormatTexel 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: ResourceStateThe 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: InitialClaimHow the importer knows initial, and so whether the
graph checks it. See InitialClaim.
final_state: ResourceStateThe 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
impl Clone for ImportedImage
Source§fn clone(&self) -> ImportedImage
fn clone(&self) -> ImportedImage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more