Record Class VmaPoolCreateInfo

java.lang.Object
java.lang.Record
club.doki7.vma.datatype.VmaPoolCreateInfo
All Implemented Interfaces:
IPointer, IVmaPoolCreateInfo

@ValueBasedCandidate @UnsafeConstructor public record VmaPoolCreateInfo(@NotNull MemorySegment segment) extends Record implements IVmaPoolCreateInfo

Describes parameter of created VmaPool.

Structure

typedef struct VmaPoolCreateInfo {
    uint32_t memoryTypeIndex;
    VmaPoolCreateFlags flags;
    VkDeviceSize blockSize;
    size_t minBlockCount;
    size_t maxBlockCount;
    float priority;
    VkDeviceSize minAllocationAlignment;
    void* pMemoryAllocateNext; // optional
} VmaPoolCreateInfo;

Contracts

The property segment() should always be not-null (segment != NULL && !segment.equals(MemorySegment.NULL)), and properly aligned to LAYOUT.byteAlignment() bytes. To represent null pointer, you may use a Java null instead. See the documentation of IPointer.segment() for more details.

The constructor of this class is marked as UnsafeConstructor, because it does not perform any runtime check. The constructor can be useful for automatic code generators.

Member documentation

  • memoryTypeIndex() Vulkan memory type index to allocate this pool from.
  • flags() Use combination of VmaPoolCreateFlagBits.
  • blockSize() 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. In this case, the pool will also support dedicated allocations.

  • minBlockCount() 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() 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.

  • priority() 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() 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() 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.

  • Field Details

    • LAYOUT

      public static final StructLayout LAYOUT
    • BYTES

      public static final long BYTES
    • PATH$memoryTypeIndex

      public static final MemoryLayout.PathElement PATH$memoryTypeIndex
    • PATH$flags

      public static final MemoryLayout.PathElement PATH$flags
    • PATH$blockSize

      public static final MemoryLayout.PathElement PATH$blockSize
    • PATH$minBlockCount

      public static final MemoryLayout.PathElement PATH$minBlockCount
    • PATH$maxBlockCount

      public static final MemoryLayout.PathElement PATH$maxBlockCount
    • PATH$priority

      public static final MemoryLayout.PathElement PATH$priority
    • PATH$minAllocationAlignment

      public static final MemoryLayout.PathElement PATH$minAllocationAlignment
    • PATH$pMemoryAllocateNext

      public static final MemoryLayout.PathElement PATH$pMemoryAllocateNext
    • LAYOUT$memoryTypeIndex

      public static final ValueLayout.OfInt LAYOUT$memoryTypeIndex
    • LAYOUT$flags

      public static final ValueLayout.OfInt LAYOUT$flags
    • LAYOUT$blockSize

      public static final ValueLayout.OfLong LAYOUT$blockSize
    • LAYOUT$priority

      public static final ValueLayout.OfFloat LAYOUT$priority
    • LAYOUT$minAllocationAlignment

      public static final ValueLayout.OfLong LAYOUT$minAllocationAlignment
    • LAYOUT$pMemoryAllocateNext

      public static final AddressLayout LAYOUT$pMemoryAllocateNext
    • SIZE$memoryTypeIndex

      public static final long SIZE$memoryTypeIndex
    • SIZE$flags

      public static final long SIZE$flags
    • SIZE$blockSize

      public static final long SIZE$blockSize
    • SIZE$minBlockCount

      public static final long SIZE$minBlockCount
    • SIZE$maxBlockCount

      public static final long SIZE$maxBlockCount
    • SIZE$priority

      public static final long SIZE$priority
    • SIZE$minAllocationAlignment

      public static final long SIZE$minAllocationAlignment
    • SIZE$pMemoryAllocateNext

      public static final long SIZE$pMemoryAllocateNext
    • OFFSET$memoryTypeIndex

      public static final long OFFSET$memoryTypeIndex
    • OFFSET$flags

      public static final long OFFSET$flags
    • OFFSET$blockSize

      public static final long OFFSET$blockSize
    • OFFSET$minBlockCount

      public static final long OFFSET$minBlockCount
    • OFFSET$maxBlockCount

      public static final long OFFSET$maxBlockCount
    • OFFSET$priority

      public static final long OFFSET$priority
    • OFFSET$minAllocationAlignment

      public static final long OFFSET$minAllocationAlignment
    • OFFSET$pMemoryAllocateNext

      public static final long OFFSET$pMemoryAllocateNext
  • Constructor Details

    • VmaPoolCreateInfo

      public VmaPoolCreateInfo(@NotNull @NotNull MemorySegment segment)
      Creates an instance of a VmaPoolCreateInfo record class.
      Parameters:
      segment - the value for the segment record component
  • Method Details