Struct vk_mem_erupt::ffi::VmaPoolCreateInfo[][src]

#[repr(C)]
pub struct VmaPoolCreateInfo { pub memoryTypeIndex: u32, pub flags: VmaPoolCreateFlags, pub blockSize: VkDeviceSize, pub minBlockCount: usize, pub maxBlockCount: usize, pub frameInUseCount: u32, pub priority: f32, pub minAllocationAlignment: VkDeviceSize, pub pMemoryAllocateNext: *mut c_void, }
Expand description

\brief Describes parameter of created #VmaPool.

Fields

memoryTypeIndex: u32

\brief Vulkan memory type index to allocate this pool from.

flags: VmaPoolCreateFlags

\brief Use combination of #VmaPoolCreateFlagBits.

blockSize: VkDeviceSize

\brief Size of a single VkDeviceMemory block to be allocated as part of this pool, in bytes. Optional.

Specify nonzero to set explicit, constant size of memory blocks used by this pool.

Leave 0 to use default and let the library manage block sizes automatically. Sizes of particular blocks may vary.

minBlockCount: usize

\brief Minimum number of blocks to be always allocated in this pool, even if they stay empty.

Set to 0 to have no preallocated blocks and allow the pool be completely empty.

maxBlockCount: usize

\brief Maximum number of blocks that can be allocated in this pool. Optional.

Set to 0 to use default, which is SIZE_MAX, which means no limit.

Set to same value as VmaPoolCreateInfo::minBlockCount to have fixed amount of memory allocated throughout whole lifetime of this pool.

frameInUseCount: u32

\brief Maximum number of additional frames that are in use at the same time as current frame.

This value is used only when you make allocations with #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT flag. Such allocation cannot become lost if allocation.lastUseFrameIndex >= allocator.currentFrameIndex - frameInUseCount.

For example, if you double-buffer your command buffers, so resources used for rendering in previous frame may still be in use by the GPU at the moment you allocate resources needed for the current frame, set this value to 1.

If you want to allow any allocations other than used in the current frame to become lost, set this value to 0.

priority: f32

\brief A floating-point value between 0 and 1, indicating the priority of the allocations in this pool relative to other memory allocations.

It is used only when #VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT flag was used during creation of the #VmaAllocator object. Otherwise, this variable is ignored.

minAllocationAlignment: VkDeviceSize

\brief Additional minimum alignment to be used for all allocations created from this pool. Can be 0.

Leave 0 (default) not to impose any additional alignment. If not 0, it must be a power of two. It can be useful in cases where alignment returned by Vulkan by functions like vkGetBufferMemoryRequirements is not enough, e.g. when doing interop with OpenGL.

pMemoryAllocateNext: *mut c_void

\brief Additional pNext chain to be attached to VkMemoryAllocateInfo used for every allocation made by this pool. Optional.

Optional, can be null. If not null, it must point to a pNext chain of structures that can be attached to VkMemoryAllocateInfo. It can be useful for special needs such as adding VkExportMemoryAllocateInfoKHR. Structures pointed by this member must remain alive and unchanged for the whole lifetime of the custom pool.

Please note that some structures, e.g. VkMemoryPriorityAllocateInfoEXT, VkMemoryDedicatedAllocateInfoKHR, can be attached automatically by this library when using other, more convenient of its features.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.