Enum vulkano::memory::MemoryImportInfo
source · [−]#[non_exhaustive]
pub enum MemoryImportInfo {
Fd {
handle_type: ExternalMemoryHandleType,
file: File,
},
}
Expand description
Parameters to import memory from an external source.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Fd
Import memory from a Unix file descriptor.
handle_type
must be either ExternalMemoryHandleType::OpaqueFd
or
ExternalMemoryHandleType::DmaBuf
.
Safety
file
must be a valid Unix file descriptor.- Vulkan will take ownership of
file
, and once the memory is imported, you must not perform any operations onfile
nor on any of its clones/duplicates. - If
file
was created by the Vulkan API, andhandle_type
isExternalMemoryHandleType::OpaqueFd
:MemoryAllocateInfo::allocation_size
andMemoryAllocateInfo::memory_type_index
must match those of the original memory allocation.- If the original memory allocation used
MemoryAllocateInfo::dedicated_allocation
, the imported one must also use it, and the associated buffer or image must be defined identically to the original.
- If
file
was not created by the Vulkan API, thenMemoryAllocateInfo::memory_type_index
must be one of the memory types returned byDevice::memory_fd_properties
.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for MemoryImportInfo
impl Send for MemoryImportInfo
impl Sync for MemoryImportInfo
impl Unpin for MemoryImportInfo
impl UnwindSafe for MemoryImportInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more