Skip to main content

GraphError

Enum GraphError 

Source
pub enum GraphError {
Show 13 variants ConflictingAccess { pass: String, resource: String, first: ResourceState, second: ResourceState, }, NoAttachments { pass: String, }, AttachmentExtentMismatch { pass: String, first: String, first_extent: (u32, u32), second: String, second_extent: (u32, u32), }, DuplicateDepthAttachment { pass: String, }, DuplicateDeclaration { pass: String, resource: String, }, SubresourceOutOfRange { pass: String, resource: String, base_mip: u32, mip_count: u32, base_layer: u32, layer_count: u32, mip_levels: u32, layers: u32, }, AttachmentOutsideRenderPass { kind: &'static str, pass: String, resource: String, }, UnusedTransient { resource: String, }, ImportStateMismatch { resource: String, declared: ResourceState, left: ResourceState, }, BufferImportStateMismatch { resource: String, declared: ResourceState, left: ResourceState, }, ImportDeclarationConflict { resource: String, field: ImportField, first: String, second: String, }, BufferImportDeclarationConflict { resource: String, field: ImportField, first: String, second: String, }, Hal(HalError),
}
Expand description

Why a graph could not be compiled.

Variants§

§

ConflictingAccess

One pass declared two different states for the same resource.

Fields

§pass: String

Pass label.

§resource: String

Resource label.

§first: ResourceState

The first state declared.

§second: ResourceState

The second, incompatible state.

§

NoAttachments

A render pass attached nothing.

Fields

§pass: String

Pass label.

§

AttachmentExtentMismatch

A render pass attached images of different sizes.

Fields

§pass: String

Pass label.

§first: String

The first attachment’s label.

§first_extent: (u32, u32)

Its size.

§second: String

The disagreeing attachment’s label.

§second_extent: (u32, u32)

Its size.

§

DuplicateDepthAttachment

A render pass attached two depth images.

Fields

§pass: String

Pass label.

§

DuplicateDeclaration

One pass declared the same resource twice over the same subrange.

.color(image, ..).color(image, ..) used to be accepted and produced two colour attachments over one view — two shader outputs writing the same pixels, in an order nothing defines. A pass that genuinely touches two parts of one image declares two different subresource ranges.

Fields

§pass: String

Pass label.

§resource: String

Resource label.

§

SubresourceOutOfRange

A pass named a mip level or array layer the image does not have.

Fields

§pass: String

Pass label.

§resource: String

Resource label.

§base_mip: u32

First mip named.

§mip_count: u32

Mip levels named.

§base_layer: u32

First layer named.

§layer_count: u32

Layers named.

§mip_levels: u32

Mip levels the image has.

§layers: u32

Array layers the image has.

§

AttachmentOutsideRenderPass

A pass that opens no render scope attached something.

Fields

§kind: &'static str

Which kind of pass declared it — PassKind::name.

§pass: String

Pass label.

§resource: String

Resource label.

§

UnusedTransient

A transient was declared and never used, so it has no lifetime and no reason to exist.

Fields

§resource: String

Resource label.

§

ImportStateMismatch

An InitialClaim::Tracked import declared a state the last graph did not leave the image in.

The whole point of the claim: the owner said it tracks this image across frames, and the pool remembers what the previous graph’s trailing barrier actually reached. When those disagree the first barrier of this frame names a source scope the GPU never visits — and if the declaration is ResourceState::Undefined it names no source scope at all, so the transition orders against nothing while the previous frame is still reading the same image.

Fields

§resource: String

Resource label.

§declared: ResourceState

What the import declared as ImportedImage::initial.

§left: ResourceState

What the last graph to execute against this pool left it in.

§

BufferImportStateMismatch

A buffer import declared a state the last graph did not leave it in.

GraphError::ImportStateMismatch for a resource with no layout, and its own variant rather than the same one because the two answers a reader needs differ. An image has a way out — say InitialClaim::Acquired and mean it — and telling a buffer’s importer to reach for a field ImportedBuffer does not have would send them looking for an escape that is not there and should not be. What is left when that clause goes is the whole of the advice: declare what the last frame left.

Fields

§resource: String

Resource label.

§declared: ResourceState

What the import declared as ImportedBuffer::initial.

§left: ResourceState

What the last graph to execute against this pool left it in.

§

ImportDeclarationConflict

One image handle was imported twice with declarations that disagree.

RenderGraph::import_image hands the second importer the id the first one got, because one handle has to be one node with one state tracker for the graph to barrier between two passes that reach it through different ids. That leaves exactly one thing it cannot do quietly: two declarations that are not the same declaration. Keeping the first would be the graph ignoring the second — silently sampling through a view it was not handed, or barriering out of a state the other importer says the image is not in — so the frame is refused instead and the two importers have to agree.

Fields

§resource: String

Resource label — the first import’s, which is the one the node kept.

§field: ImportField

Which field of ImportedImage disagreed.

§first: String

What the first import declared it as, Debug-printed.

§second: String

What the later import declared it as.

§

BufferImportDeclarationConflict

One buffer handle was imported twice with declarations that disagree.

GraphError::ImportDeclarationConflict for a resource with no layout, and a variant of its own for the same reason GraphError::BufferImportStateMismatch is one: the message names the resource kind, and a caller matching on the error is usually looking at one kind of resource.

Fields

§resource: String

Resource label — the first import’s, which is the one the node kept.

§field: ImportField

Which field of ImportedBuffer disagreed.

§first: String

What the first import declared it as, Debug-printed.

§second: String

What the later import declared it as.

§

Hal(HalError)

The seam refused something at execution time.

Trait Implementations§

Source§

impl Debug for GraphError

Source§

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

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

impl Display for GraphError

Source§

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

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

impl Error for GraphError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<HalError> for GraphError

Source§

fn from(source: HalError) -> GraphError

Converts to this type from the input type.

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.