Skip to main content

InitialClaim

Enum InitialClaim 

Source
pub enum InitialClaim {
    Tracked,
    Acquired,
}
Expand description

What backs an importer’s claim about ImportedImage::initial.

initial is the one thing in a graph the graph cannot derive, and getting it wrong is silent: a barrier out of a state the image is not in still records, still renders, and still passes every golden — it just carries the wrong source scope, and Undefined carries none at all. So the importer has to say how it knows, and that answer decides whether the graph can check the claim or has to take it.

Images only, and that is a fact about the resources rather than about the check. ImportedBuffer::initial is the same declaration and is audited on the same ledger, but it has no counterpart to this enum: Acquired is the only reason an import escapes the audit, an acquire is what a swapchain does, and a swapchain hands out images. Giving a buffer a claim field with one legal value would be an escape hatch with no case behind it — and the Acquired docs below are about how such a hatch is how the check gets lost.

Variants§

§

Tracked

The importer owns this image across frames, so initial is checkable.

RenderGraph::compile looks the image up in the pool’s ledger of what the last graph left each tracked import in, and rejects a declaration that disagrees with it — see GraphError::ImportStateMismatch. A handle the ledger has never heard of is accepted: the graph has left it in nothing, so there is nothing for the claim to contradict, and an image put into ShaderRead by an upload outside the graph is the ordinary case of that.

The right answer for anything the importer keeps and re-imports — a shadow atlas, a 1×1 placeholder, an offscreen target it renders into twice. Both of the bugs this check exists to stop were images of exactly that kind: one declared ResourceState::Undefined on a placeholder the frame before had left in ResourceState::ShaderRead, which is a write-after-read with no source scope; the other named ResourceState::ColorAttachment on an image the graph had already returned to ResourceState::Present, which is an illegal old layout.

§

Acquired

An acquire semaphore stands between the last use and this frame, so there is nothing left for initial to order against.

The freshly acquired swapchain image, and only that shape. Its ResourceState::Undefined is not a lie the graph should catch: the semaphore the acquire signalled is waited on by the submission that runs this graph, so the frame is already ordered after everything the presentation engine and the previous frame did with the image, and the first barrier has no ordering left to carry — only a layout to reach.

Which is also why the graph cannot check one. The image goes back into the presentation ring at ResourceState::Present and the window system does what it likes with it; a ledger entry saying what this frame left would be a claim about an image the engine no longer controls. So the ledger does not record these at all, and nothing reads them.

Reaching for this to quiet a rejection is how the check gets lost. A tracked image marked Acquired opts out of the whole guard and reads as verified; if a declaration is refused and there is no acquire in the chain, the declaration is what is wrong.

Trait Implementations§

Source§

impl Clone for InitialClaim

Source§

fn clone(&self) -> InitialClaim

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 InitialClaim

Source§

impl Debug for InitialClaim

Source§

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

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

impl Eq for InitialClaim

Source§

impl PartialEq for InitialClaim

Source§

fn eq(&self, other: &InitialClaim) -> 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 InitialClaim

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.