Struct vulkano::memory::DeviceMemoryBuilder [−][src]
pub struct DeviceMemoryBuilder<'a> { /* fields omitted */ }
Expand description
Represents a builder for the device memory object.
Example
use vulkano::memory::DeviceMemoryBuilder;
let mem_ty = device.physical_device().memory_types().next().unwrap();
// Allocates 1KB of memory.
let memory = DeviceMemoryBuilder::new(device, mem_ty.id(), 1024).build().unwrap();
Implementations
pub fn new(
device: Arc<Device>,
memory_index: u32,
size: DeviceSize
) -> DeviceMemoryBuilder<'a>
pub fn new(
device: Arc<Device>,
memory_index: u32,
size: DeviceSize
) -> DeviceMemoryBuilder<'a>
Returns a new DeviceMemoryBuilder
given the required device, memory type and size fields.
Validation of parameters is done when the builder is built.
Sets an optional field for dedicated allocations in the DeviceMemoryBuilder
. To maintain
backwards compatibility, this function does nothing when dedicated allocation has not been
enabled on the device.
Panic
- Panics if the dedicated allocation info has already been set.
Sets an optional field for exportable allocations in the DeviceMemoryBuilder
.
Panic
- Panics if the export info has already been set.
pub fn import_info(
self,
fd: File,
handle_types: ExternalMemoryHandleType
) -> DeviceMemoryBuilder<'a>
pub fn import_info(
self,
fd: File,
handle_types: ExternalMemoryHandleType
) -> DeviceMemoryBuilder<'a>
Sets an optional field for importable DeviceMemory in the DeviceMemoryBuilder
.
Panic
- Panics if the import info has already been set.
Creates a DeviceMemory
object on success, consuming the DeviceMemoryBuilder
. An error
is returned if the requested allocation is too large or if the total number of allocations
would exceed per-device limits.
Auto Trait Implementations
impl<'a> RefUnwindSafe for DeviceMemoryBuilder<'a>
impl<'a> !Send for DeviceMemoryBuilder<'a>
impl<'a> !Sync for DeviceMemoryBuilder<'a>
impl<'a> Unpin for DeviceMemoryBuilder<'a>
impl<'a> UnwindSafe for DeviceMemoryBuilder<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
Builds a pointer to this type from a raw pointer.
Returns true if the size is suitable to store a type like this.
Returns the size of an individual element.