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]
impl<'a> DeviceMemoryBuilder<'a>
[src]pub fn new(
device: Arc<Device>,
memory_index: u32,
size: usize
) -> 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]
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]
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]
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]
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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Content for T
[src]
impl<T> Content for T
[src]pub fn ref_from_ptr(*mut c_void, usize) -> Option<*mut 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]
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]
pub fn indiv_size() -> usize
[src]Returns the size of an individual element.