pub struct AllocationChain<'a> { /* private fields */ }Expand description
A caller-owned VkMemoryAllocateInfo::pNext chain.
The allocator prepends its dedication and admitted priority/address records. Explicit flags are preserved, including a device mask; resource dedication and priority belong to the allocator and must not also appear in this chain. No native handle is owned by this borrowed descriptor.
Implementations§
Source§impl<'a> AllocationChain<'a>
impl<'a> AllocationChain<'a>
Sourcepub unsafe fn new_from_record<T: Extends<MemoryAllocateInfo<'a>>>(
record: &'a T,
) -> Result<Self, AllocError>
pub unsafe fn new_from_record<T: Extends<MemoryAllocateInfo<'a>>>( record: &'a T, ) -> Result<Self, AllocError>
Borrow a registered allocation extension and its linked records.
§Errors
Rejects cycles, duplicate tags, overlong chains, allocator-owned records and native records without an admitted allocator ownership/accounting contract.
§Safety
Every reachable header and full payload must be valid, correctly tagged,
immutable and readable for 'a; all nested pointers/handles and enabled
capabilities must meet native valid usage at allocation. Imports must use
an explicitly compatible memory type/size. Native import handle transfer
occurs on successful vkAllocateMemory, even if later mapping/binding fails.
Sourcepub unsafe fn new_from_record_with_import<T: Extends<MemoryAllocateInfo<'a>>>(
record: &'a T,
info: ImportMemoryInfo,
) -> Result<Self, AllocError>
pub unsafe fn new_from_record_with_import<T: Extends<MemoryAllocateInfo<'a>>>( record: &'a T, info: ImportMemoryInfo, ) -> Result<Self, AllocError>
Borrow an import chain with explicit external payload accounting.
Use this for platform imports whose native allocation size is ignored or whose compatible types come from external properties. No OS query is guessed.
§Errors
Same chain validation as new_from_record, plus absent/invalid import
metadata, null resource identities and incompatible dedication policy.
§Safety
The complete new_from_record contract applies. info must describe this
exact payload and device: obtain size/types from the platform Vulkan query
or authoritative OS/export metadata. Include all backing bytes, even when
native allocationSize is ignored/zero. A supplied resource must be live,
unbound, compatible, and have requirements covered by this size/type mask.
Every native dedication rule still applies, including an exact requirements
size wherever required. Fuchsia collection resource/index/size must match.
Android/QNX/OHOS image profiles and Metal textures require their image.
External host/OS objects must survive every native use, not just this borrow.