Skip to main content

create_aliasing_buffer

Function create_aliasing_buffer 

Source
pub unsafe fn create_aliasing_buffer(
    allocator: &mut Allocator<'_>,
    allocation: &Allocation,
    local_offset: u64,
    info: &BufferCreateInfo<'_>,
) -> Result<Buffer, AllocError>
Expand description

Create an ordinary alias buffer at a checked allocation-local offset.

Backing storage must have can_alias; no new memory or allocation token is created. Aliases are caller-owned: destroy every alias before freeing storage. Original resource association and binding state remain unchanged.

§Errors

Rejects non-aliasable/foreign/stale storage, invalid requirements/offset/type, required native dedication, unavailable PFNs or native creation/binding failure.

§Safety

Follow Vulkan aliasing, barrier, native resource/feature and callback rules. Do not access overlapping aliases concurrently. Retain all native lifetimes. Use allocation_callbacks() for matching explicit native alias destruction.