Struct vma::AllocatorPool
source · pub struct AllocatorPool { /* private fields */ }
Expand description
Represents custom memory pool handle.
Implementations§
source§impl AllocatorPool
impl AllocatorPool
pub fn set_name(&self, name: Option<&CStr>)
pub fn name(&self) -> Option<&CStr>
sourcepub fn get_statistics(&self) -> VkResult<VmaStatistics>
pub fn get_statistics(&self) -> VkResult<VmaStatistics>
Retrieves statistics of existing AllocatorPool
object.
sourcepub fn calculate_statistics(&self) -> VkResult<VmaDetailedStatistics>
pub fn calculate_statistics(&self) -> VkResult<VmaDetailedStatistics>
Retrieves statistics of existing AllocatorPool
object.
sourcepub fn check_corruption(&self) -> VkResult<()>
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
impl Alloc for AllocatorPool
fn allocator(&self) -> &Allocator
fn pool(&self) -> PoolHandle
source§unsafe fn find_memory_type_index(
&self,
memory_type_bits: u32,
allocation_info: &AllocationCreateInfo
) -> VkResult<u32>
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>
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>
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>
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>>
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>
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>
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)>
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)>
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)>
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
impl Drop for AllocatorPool
impl Send for AllocatorPool
impl Sync for AllocatorPool
Auto Trait Implementations§
impl RefUnwindSafe for AllocatorPool
impl Unpin for AllocatorPool
impl UnwindSafe for AllocatorPool
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more