pub struct ResourceDesc {
pub name: String,
pub kind: ResourceKind,
pub imported: bool,
pub allocation_class: u64,
}Expand description
Declaration of a graph resource.
Fields§
§name: StringHuman-readable name, for diagnostics.
kind: ResourceKindThe kind of resource.
imported: boolWhether the resource is imported (externally owned) rather than transient.
Transient resources are owned by the graph and may alias memory with other transients whose lifetimes do not overlap.
allocation_class: u64Caller-defined compatibility class for transient-memory aliasing.
Resources share a physical slot only when their kind and allocation class match. Encode every backend constraint that prevents memory reuse, such as dimensions, format, sample count, and usage flags.
Implementations§
Source§impl ResourceDesc
impl ResourceDesc
Sourcepub fn transient_texture(name: impl Into<String>) -> Self
pub fn transient_texture(name: impl Into<String>) -> Self
A transient texture resource with the given name.
Sourcepub fn imported_texture(name: impl Into<String>) -> Self
pub fn imported_texture(name: impl Into<String>) -> Self
An imported (externally owned) texture resource with the given name.
Sourcepub fn allocation_class(self, allocation_class: u64) -> Self
pub fn allocation_class(self, allocation_class: u64) -> Self
Set the backend-defined transient-allocation compatibility class.
Trait Implementations§
Source§impl Clone for ResourceDesc
impl Clone for ResourceDesc
Auto Trait Implementations§
impl Freeze for ResourceDesc
impl RefUnwindSafe for ResourceDesc
impl Send for ResourceDesc
impl Sync for ResourceDesc
impl Unpin for ResourceDesc
impl UnsafeUnpin for ResourceDesc
impl UnwindSafe for ResourceDesc
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