pub struct ResourceVersionChain {
pub handle: ResourceHandle,
pub descriptor: ResourceDescriptor,
pub lifetime: ResourceLifetime,
pub versions: Vec<(u32, String)>,
pub readers: HashMap<u32, Vec<String>>,
}Expand description
Tracks all versions of a single logical resource within one frame, enabling read-after-write hazard detection.
Fields§
§handle: ResourceHandle§descriptor: ResourceDescriptor§lifetime: ResourceLifetime§versions: Vec<(u32, String)>Ordered list of (version, writer_pass_name).
readers: HashMap<u32, Vec<String>>Readers per version: version -> list of pass names.
Implementations§
Source§impl ResourceVersionChain
impl ResourceVersionChain
pub fn new( handle: ResourceHandle, descriptor: ResourceDescriptor, lifetime: ResourceLifetime, ) -> Self
Sourcepub fn record_write(&mut self, pass_name: &str) -> u32
pub fn record_write(&mut self, pass_name: &str) -> u32
Record a write, bumping version.
Sourcepub fn record_read(&mut self, version: u32, pass_name: &str)
pub fn record_read(&mut self, version: u32, pass_name: &str)
Record a read at a specific version.
Sourcepub fn current_version(&self) -> u32
pub fn current_version(&self) -> u32
The current (latest) version.
Sourcepub fn has_raw_hazard(&self) -> bool
pub fn has_raw_hazard(&self) -> bool
Detect if a read-after-write hazard exists: a pass reads version N while another pass writes version N+1.
Trait Implementations§
Source§impl Clone for ResourceVersionChain
impl Clone for ResourceVersionChain
Source§fn clone(&self) -> ResourceVersionChain
fn clone(&self) -> ResourceVersionChain
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ResourceVersionChain
impl RefUnwindSafe for ResourceVersionChain
impl Send for ResourceVersionChain
impl Sync for ResourceVersionChain
impl Unpin for ResourceVersionChain
impl UnsafeUnpin for ResourceVersionChain
impl UnwindSafe for ResourceVersionChain
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
Mutably borrows from an owned value. Read more