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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> Content for T[src]

pub fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>[src]

Builds a pointer to this type from a raw pointer.

pub fn is_size_suitable(usize) -> bool[src]

Returns true if the size is suitable to store a type like this.

pub fn indiv_size() -> usize[src]

Returns the size of an individual element.

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.