Realm

vk::mem · Functions · G1

Export a new caller-owned file descriptor for the complete backing memory. Allocation offsets still apply. Close the returned descriptor using the OS; neither token nor allocator owns it. No GPU synchronization occurs.

FnRustExperimental

Fnvk::mem::get_memory_fd

pub unsafe fn get_memory_fd( allocator: &Allocator<'_>, allocation: &Allocation, handle_type: ExternalMemoryHandleTypeFlagBits, ) -> Result<RawFd, AllocError>
Export a new caller-owned file descriptor for the complete backing memory. Allocation offsets still apply. Close the returned descriptor using the OS; neither token nor allocator owns it. No GPU synchronization occurs.

Contract

Export a new caller-owned file descriptor for the complete backing memory. Allocation offsets still apply. Close the returned descriptor using the OS; neither token nor allocator owns it. No GPU synchronization occurs.

Errors

Rejects stale/non-exportable allocations, invalid types, missing enabled extensions/PFNs and native failures. Native failure transfers no descriptor.

Safety

Meet native external-memory compatibility, sharing/security and synchronization contracts. The caller closes each successful descriptor exactly once.