Record Class VmaAllocationInfo2

java.lang.Object
java.lang.Record
club.doki7.vma.datatype.VmaAllocationInfo2
All Implemented Interfaces:
IPointer, IVmaAllocationInfo2

@ValueBasedCandidate @UnsafeConstructor public record VmaAllocationInfo2(@NotNull MemorySegment segment) extends Record implements IVmaAllocationInfo2

Extended parameters of a VmaAllocation object that can be retrieved using function vmaGetAllocationInfo2().

Structure

typedef struct VmaAllocationInfo2 {
    VmaAllocationInfo allocationInfo;
    VkDeviceSize blockSize;
    VkBool32 dedicatedMemory;
} VmaAllocationInfo2;

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

  • allocationInfo() Basic parameters of the allocation.

    If you need only these, you can use function vmaGetAllocationInfo() and structure VmaAllocationInfo instead.

  • blockSize() Size of the `VkDeviceMemory` block that the allocation belongs to.

    In case of an allocation with dedicated memory, it will be equal to allocationInfo.size.

  • dedicatedMemory() `VK_TRUE` if the allocation has dedicated memory, `VK_FALSE` if it was placed as part of a larger memory block.

    When VK_TRUE, it also means VkMemoryDedicatedAllocateInfo was used when creating the allocation (if VK_KHR_dedicated_allocation extension or Vulkan version >= 1.1 is enabled).

  • Field Details

    • LAYOUT

      public static final StructLayout LAYOUT
    • BYTES

      public static final long BYTES
    • PATH$allocationInfo

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

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

      public static final MemoryLayout.PathElement PATH$dedicatedMemory
    • LAYOUT$allocationInfo

      public static final StructLayout LAYOUT$allocationInfo
    • LAYOUT$blockSize

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

      public static final ValueLayout.OfInt LAYOUT$dedicatedMemory
    • SIZE$allocationInfo

      public static final long SIZE$allocationInfo
    • SIZE$blockSize

      public static final long SIZE$blockSize
    • SIZE$dedicatedMemory

      public static final long SIZE$dedicatedMemory
    • OFFSET$allocationInfo

      public static final long OFFSET$allocationInfo
    • OFFSET$blockSize

      public static final long OFFSET$blockSize
    • OFFSET$dedicatedMemory

      public static final long OFFSET$dedicatedMemory
  • Constructor Details

    • VmaAllocationInfo2

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

    • allocate

      public static VmaAllocationInfo2 allocate(Arena arena)
    • allocate

      public static VmaAllocationInfo2.Ptr allocate(Arena arena, long count)
    • clone

      public static VmaAllocationInfo2 clone(Arena arena, VmaAllocationInfo2 src)
    • allocationInfo

      @NotNull public @NotNull VmaAllocationInfo allocationInfo()
    • allocationInfo

      public VmaAllocationInfo2 allocationInfo(@NotNull @NotNull VmaAllocationInfo value)
    • allocationInfo

      public VmaAllocationInfo2 allocationInfo(Consumer<@NotNull VmaAllocationInfo> consumer)
    • blockSize

      @NativeType("VkDeviceSize") @Unsigned public long blockSize()
    • blockSize

      public VmaAllocationInfo2 blockSize(@NativeType("VkDeviceSize") @Unsigned long value)
    • dedicatedMemory

      @NativeType("VkBool32") @Unsigned public int dedicatedMemory()
    • dedicatedMemory

      public VmaAllocationInfo2 dedicatedMemory(@NativeType("VkBool32") @Unsigned int value)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • segment

      @NotNull public @NotNull MemorySegment segment()
      Returns the value of the segment record component.
      Specified by:
      segment in interface IPointer
      Returns:
      the value of the segment record component