Struct vulkano::memory::DeviceMemoryBuilder[][src]

pub struct DeviceMemoryBuilder<'a> { /* fields omitted */ }

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

impl<'a> DeviceMemoryBuilder<'a>[src]

pub fn new(
    device: Arc<Device>,
    memory_index: u32,
    size: usize
) -> DeviceMemoryBuilder<'a>
[src]

Returns a new DeviceMemoryBuilder given the required device, memory type and size fields. Validation of parameters is done when the builder is built.

pub fn dedicated_info(
    self,
    dedicated: DedicatedAlloc<'a>
) -> DeviceMemoryBuilder<'_>
[src]

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.

pub fn export_info(
    self,
    handle_types: ExternalMemoryHandleType
) -> DeviceMemoryBuilder<'a>
[src]

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>
[src]

Sets an optional field for importable DeviceMemory in the DeviceMemoryBuilder.

Panic

  • Panics if the import info has already been set.

pub fn build(self) -> Result<Arc<DeviceMemory>, DeviceMemoryAllocError>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Content for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.