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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.