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§
Trait Implementations§
Source§impl Clone for GraphResourceClass
impl Clone for GraphResourceClass
Source§fn clone(&self) -> GraphResourceClass
fn clone(&self) -> GraphResourceClass
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for GraphResourceClass
Source§impl Debug for GraphResourceClass
impl Debug for GraphResourceClass
impl Eq for GraphResourceClass
Source§impl PartialEq for GraphResourceClass
impl PartialEq for GraphResourceClass
impl StructuralPartialEq for GraphResourceClass
Auto Trait Implementations§
impl Freeze for GraphResourceClass
impl RefUnwindSafe for GraphResourceClass
impl Send for GraphResourceClass
impl Sync for GraphResourceClass
impl Unpin for GraphResourceClass
impl UnsafeUnpin for GraphResourceClass
impl UnwindSafe for GraphResourceClass
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.