logo
pub struct DeviceMemoryBuilder<'a> { /* private fields */ }
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

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.

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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

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.

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.