Allocator

Struct Allocator 

Source
pub struct Allocator(/* private fields */);

Implementations§

Source§

impl Allocator

Source

pub unsafe fn new(options: &AllocatorOptions<'_>) -> VkResult<Self>

Source

pub fn get_physical_device_properties(&self) -> PhysicalDeviceProperties

Source

pub fn get_memory_properties(&self) -> &PhysicalDeviceMemoryProperties

Source

pub fn calculate_statistics(&self) -> VkResult<VmaTotalStatistics>

Source

pub fn get_heap_budgets(&self) -> VkResult<Vec<VmaBudget>>

Source

pub fn check_corruption(&self, flags: MemoryPropertyFlags) -> VkResult<()>

Source

pub fn get_allocation_info(&self, allocation: Allocation) -> VmaAllocationInfo

Source

pub unsafe fn set_current_frame_index(&self, frame_index: u32)

Source

pub unsafe fn map_memory(&self, allocation: Allocation) -> VkResult<*mut u8>

Source

pub unsafe fn unmap_memory(&self, allocation: Allocation)

Source

pub unsafe fn bind_buffer_memory( &self, allocation: Allocation, buffer: Buffer, ) -> VkResult<()>

Source

pub unsafe fn bind_buffer_memory2( &self, allocation: Allocation, allocation_local_offset: DeviceSize, buffer: Buffer, next: *const c_void, ) -> VkResult<()>

Source

pub unsafe fn bind_image_memory( &self, allocation: Allocation, image: Image, ) -> VkResult<()>

Source

pub unsafe fn bind_image_memory2( &self, allocation: Allocation, allocation_local_offset: DeviceSize, image: Image, next: *const c_void, ) -> VkResult<()>

Source

pub unsafe fn free_memory(&self, allocation: Allocation)

Source

pub unsafe fn free_memory_pages(&self, allocations: &[Allocation])

Source

pub unsafe fn destroy_buffer(&self, buffer: Buffer, allocation: Allocation)

Source

pub unsafe fn destroy_image(&self, image: Image, allocation: Allocation)

Source

pub unsafe fn flush_allocation( &self, allocation: Allocation, offset: DeviceSize, size: DeviceSize, ) -> VkResult<()>

Source

pub unsafe fn invalidate_allocation( &self, allocation: Allocation, offset: DeviceSize, size: DeviceSize, ) -> VkResult<()>

Source§

impl Allocator

Source

pub fn create_pool( self: &Arc<Self>, options: &PoolOptions<'_>, ) -> VkResult<Pool>

Source

pub fn get_default_pool(self: &Arc<Self>) -> Pool

Trait Implementations§

Source§

impl Alloc for Allocator

Source§

fn allocator(&self) -> &Allocator

Source§

fn pool(&self) -> PoolHandle

Source§

unsafe fn find_memory_type_index( &self, memory_type_bits: u32, options: &AllocationOptions, ) -> VkResult<u32>

Source§

unsafe fn find_memory_type_index_for_buffer_info( &self, buffer_info: impl Cast<Target = BufferCreateInfo>, options: &AllocationOptions, ) -> VkResult<u32>

Source§

unsafe fn find_memory_type_index_for_image_info( &self, image_info: impl Cast<Target = ImageCreateInfo>, options: &AllocationOptions, ) -> VkResult<u32>

Source§

unsafe fn allocate_memory( &self, requirements: impl Cast<Target = MemoryRequirements>, options: &AllocationOptions, ) -> VkResult<Allocation>

Source§

unsafe fn allocate_memory_pages( &self, requirements: impl Cast<Target = MemoryRequirements>, options: &AllocationOptions, num_pages: usize, ) -> VkResult<Vec<Allocation>>

Source§

unsafe fn allocate_memory_for_buffer( &self, buffer: Buffer, options: &AllocationOptions, ) -> VkResult<Allocation>

Source§

unsafe fn allocate_memory_for_image( &self, image: Image, options: &AllocationOptions, ) -> VkResult<Allocation>

Source§

unsafe fn create_buffer( &self, buffer_info: impl Cast<Target = BufferCreateInfo>, options: &AllocationOptions, ) -> VkResult<(Buffer, Allocation)>

Source§

unsafe fn create_buffer_with_alignment( &self, buffer_info: impl Cast<Target = BufferCreateInfo>, options: &AllocationOptions, min_alignment: DeviceSize, ) -> VkResult<(Buffer, Allocation)>

Source§

unsafe fn create_image( &self, image_info: impl Cast<Target = ImageCreateInfo>, options: &AllocationOptions, ) -> VkResult<(Image, Allocation)>

Source§

impl Debug for Allocator

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Allocator

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for Allocator

Source§

impl Sync for Allocator

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.