pub enum ResourceState {
Undefined,
Read,
Write,
}Expand description
Coarse per-resource state used by the barrier deriver. The
executor maps each to the backend’s concrete state: for Vulkan a
VkImageLayout + VkAccessFlags pair, for DirectX a
D3D12_RESOURCE_STATES, for Metal mostly a no-op except useResource
on the ICB-driven cull pass.
Variants§
Undefined
Initial state before any pass uses the resource. Reading from
Undefined is a compile error (a read with no producer); writing
to it is always legal and transitions the state to a writer
variant below.
Read
A pass reads the resource (sampled texture, uniform / SSBO, indirect-args buffer, depth read, …). Multiple consecutive reads are coalesced: they don’t insert barriers between themselves.
Write
A pass writes the resource (render target, depth-stencil target, storage write, blend write). A second write after a read inserts a Write→Read→Write barrier chain; consecutive writes by the same pass do not, but consecutive writes across passes do.
Trait Implementations§
Source§impl Clone for ResourceState
impl Clone for ResourceState
Source§fn clone(&self) -> ResourceState
fn clone(&self) -> ResourceState
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 ResourceState
Source§impl Debug for ResourceState
impl Debug for ResourceState
impl Eq for ResourceState
Source§impl PartialEq for ResourceState
impl PartialEq for ResourceState
impl StructuralPartialEq for ResourceState
Auto Trait Implementations§
impl Freeze for ResourceState
impl RefUnwindSafe for ResourceState
impl Send for ResourceState
impl Sync for ResourceState
impl Unpin for ResourceState
impl UnsafeUnpin for ResourceState
impl UnwindSafe for ResourceState
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.