Skip to main content

GraphResourceClass

Enum GraphResourceClass 

Source
pub enum GraphResourceClass {
    ColorTarget,
    DepthTarget,
    StorageImage,
    IndirectBuffer,
    StorageBuffer,
    UnorderedBuffer,
}
Expand description

How a graph resource a backend drives from barriers_before is used, so the backend can translate the coarse ResourceState into a concrete native state: the same Write means a colour render target for one resource and a depth-stencil target for another, which map to different D3D12_RESOURCE_STATES / vk::ImageLayouts. The backend resolver assigns a class to each migrated resource; the backend’s barrier translator maps (class, state) to its native state. Extend as resources of new kinds (storage / compute targets, …) migrate.

Variants§

§

ColorTarget

Sampled colour render target (e.g. the SSAO occlusion ao_output).

§

DepthTarget

Sampled depth-stencil render target (e.g. the CSM shadow_map).

§

StorageImage

Compute-written, shader-sampled storage image (e.g. the volumetric-fog fog_froxel_volume): a compute pass writes it (DirectX UNORDERED_ACCESS / Vulkan GENERAL) and a later fragment pass samples it. Unlike the two target classes its Write happens in the compute stage, so the translated state pairs a storage-write layout with the compute pipeline stage.

§

IndirectBuffer

Compute-written buffer consumed as draw arguments (e.g. the GPU cull pass’s draw_args): a compute pass writes it and the drawing pass reads it through the indirect-draw stage, which is neither of the shader stages ReadStages models. Buffers carry no layout, so a transition on this class is a pure execution + memory dependency.

§

StorageBuffer

Compute-written, shader-read buffer (e.g. the clustered-lighting cluster_light_list). Like IndirectBuffer it has no layout; its read side follows the consuming stage union, so it reads as a shader resource.

§

UnorderedBuffer

Buffer both written and read through an unordered-access view (e.g. the two-pass cull’s cull_status, which phase 1 writes and phase 2 reads with the same binding). Distinct from StorageBuffer because its read is not a shader-resource read: on DirectX it never leaves UNORDERED_ACCESS, so its ordering comes from a UAV barrier rather than a state transition.

Implementations§

Source§

impl GraphResourceClass

Source

pub const fn is_buffer(self) -> bool

Whether this class names a buffer rather than an image. Buffers have no layout, so a backend emits a buffer / global memory barrier for them and an image barrier for everything else.

Trait Implementations§

Source§

impl Clone for GraphResourceClass

Source§

fn clone(&self) -> GraphResourceClass

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 GraphResourceClass

Source§

impl Debug for GraphResourceClass

Source§

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

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

impl Eq for GraphResourceClass

Source§

impl PartialEq for GraphResourceClass

Source§

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

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> 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.