Struct vma::AllocatorPool

source ·
pub struct AllocatorPool { /* private fields */ }
Expand description

Represents custom memory pool handle.

Implementations§

source§

impl AllocatorPool

source

pub fn set_name(&self, name: Option<&CStr>)

source

pub fn name(&self) -> Option<&CStr>

source

pub fn get_statistics(&self) -> VkResult<VmaStatistics>

Retrieves statistics of existing AllocatorPool object.

source

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

Retrieves statistics of existing AllocatorPool object.

source

pub fn check_corruption(&self) -> VkResult<()>

Checks magic number in margins around all allocations in given memory pool in search for corruptions.

Corruption detection is enabled only when VMA_DEBUG_DETECT_CORRUPTION macro is defined to nonzero, VMA_DEBUG_MARGIN is defined to nonzero and the pool is created in memory type that is ash::vk::MemoryPropertyFlags::HOST_VISIBLE and ash::vk::MemoryPropertyFlags::HOST_COHERENT.

Possible error values:

  • ash::vk::Result::ERROR_FEATURE_NOT_PRESENT - corruption detection is not enabled for specified pool.
  • ash::vk::Result::ERROR_VALIDATION_FAILED_EXT - corruption detection has been performed and found memory corruptions around one of the allocations. VMA_ASSERT is also fired in that case.
  • Other value: Error returned by Vulkan, e.g. memory mapping failure.

Trait Implementations§

source§

impl Alloc for AllocatorPool

source§

fn allocator(&self) -> &Allocator

source§

fn pool(&self) -> PoolHandle

source§

unsafe fn find_memory_type_index( &self, memory_type_bits: u32, allocation_info: &AllocationCreateInfo ) -> VkResult<u32>

Helps to find memory type index, given memory type bits and allocation info. Read more
source§

unsafe fn find_memory_type_index_for_buffer_info( &self, buffer_info: &BufferCreateInfo, allocation_info: &AllocationCreateInfo ) -> VkResult<u32>

Helps to find memory type index, given buffer info and allocation info. Read more
source§

unsafe fn find_memory_type_index_for_image_info( &self, image_info: ImageCreateInfo, allocation_info: &AllocationCreateInfo ) -> VkResult<u32>

Helps to find memory type index, given image info and allocation info. Read more
source§

unsafe fn allocate_memory( &self, memory_requirements: &MemoryRequirements, create_info: &AllocationCreateInfo ) -> VkResult<Allocation>

General purpose memory allocation. Read more
source§

unsafe fn allocate_memory_pages( &self, memory_requirements: &MemoryRequirements, create_info: &AllocationCreateInfo, allocation_count: usize ) -> VkResult<Vec<Allocation>>

General purpose memory allocation for multiple allocation objects at once. Read more
source§

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

Buffer specialized memory allocation. Read more
source§

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

Image specialized memory allocation. Read more
source§

unsafe fn create_buffer( &self, buffer_info: &BufferCreateInfo, create_info: &AllocationCreateInfo ) -> VkResult<(Buffer, Allocation)>

This function automatically creates a buffer, allocates appropriate memory for it, and binds the buffer with the memory. Read more
source§

unsafe fn create_buffer_with_alignment( &self, buffer_info: &BufferCreateInfo, create_info: &AllocationCreateInfo, min_alignment: DeviceSize ) -> VkResult<(Buffer, Allocation)>

brief Creates a buffer with additional minimum alignment. Read more
source§

unsafe fn create_image( &self, image_info: &ImageCreateInfo, create_info: &AllocationCreateInfo ) -> VkResult<(Image, Allocation)>

This function automatically creates an image, allocates appropriate memory for it, and binds the image with the memory. Read more
source§

impl Drop for AllocatorPool

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Send for AllocatorPool

source§

impl Sync for AllocatorPool

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.