Class VkMemoryRequirements

java.lang.Object
overrungl.struct.GroupType
overrungl.vulkan.struct.VkMemoryRequirements
All Implemented Interfaces:
Addressable
Direct Known Subclasses:
VkMemoryRequirements.Buffer

public sealed class VkMemoryRequirements extends GroupType permits VkMemoryRequirements.Buffer

Layout

struct VkMemoryRequirements {
    (uint64_t) VkDeviceSize size;
    (uint64_t) VkDeviceSize alignment;
    uint32_t memoryTypeBits;
};
  • Field Details

    • LAYOUT

      public static final GroupLayout LAYOUT
      The struct layout of VkMemoryRequirements.
    • OFFSET_size

      public static final long OFFSET_size
      The byte offset of size.
    • LAYOUT_size

      public static final MemoryLayout LAYOUT_size
      The memory layout of size.
    • VH_size

      public static final VarHandle VH_size
      The VarHandle of size of type (MemorySegment base, long baseOffset, long index)MemorySegment.
    • OFFSET_alignment

      public static final long OFFSET_alignment
      The byte offset of alignment.
    • LAYOUT_alignment

      public static final MemoryLayout LAYOUT_alignment
      The memory layout of alignment.
    • VH_alignment

      public static final VarHandle VH_alignment
      The VarHandle of alignment of type (MemorySegment base, long baseOffset, long index)MemorySegment.
    • OFFSET_memoryTypeBits

      public static final long OFFSET_memoryTypeBits
      The byte offset of memoryTypeBits.
    • LAYOUT_memoryTypeBits

      public static final MemoryLayout LAYOUT_memoryTypeBits
      The memory layout of memoryTypeBits.
    • VH_memoryTypeBits

      public static final VarHandle VH_memoryTypeBits
      The VarHandle of memoryTypeBits of type (MemorySegment base, long baseOffset, long index)MemorySegment.
  • Constructor Details

    • VkMemoryRequirements

      public VkMemoryRequirements(MemorySegment segment)
      Creates VkMemoryRequirements with the given segment.
      Parameters:
      segment - the memory segment
  • Method Details

    • of

      public static VkMemoryRequirements.Buffer of(MemorySegment segment)
      Creates VkMemoryRequirements with the given segment.
      Parameters:
      segment - the memory segment
      Returns:
      the created instance or null if the segment is NULL
    • ofNative

      public static VkMemoryRequirements ofNative(MemorySegment segment)

      Creates VkMemoryRequirements with the given segment.

      Reinterprets the segment if zero-length.

      Parameters:
      segment - the memory segment
      Returns:
      the created instance or null if the segment is NULL
    • ofNative

      public static VkMemoryRequirements.Buffer ofNative(MemorySegment segment, long count)

      Creates VkMemoryRequirements with the given segment.

      Reinterprets the segment if zero-length.

      Parameters:
      segment - the memory segment
      count - the count of the buffer
      Returns:
      the created instance or null if the segment is NULL
    • alloc

      public static VkMemoryRequirements alloc(SegmentAllocator allocator)
      Allocates a VkMemoryRequirements with the given segment allocator.
      Parameters:
      allocator - the segment allocator
      Returns:
      the allocated VkMemoryRequirements
    • alloc

      public static VkMemoryRequirements.Buffer alloc(SegmentAllocator allocator, long count)
      Allocates a VkMemoryRequirements with the given segment allocator and count.
      Parameters:
      allocator - the segment allocator
      count - the count
      Returns:
      the allocated VkMemoryRequirements
    • copyFrom

      Copies from the given source.
      Parameters:
      src - the source
      Returns:
      this
    • asBuffer

      public VkMemoryRequirements.Buffer asBuffer()
      Converts this instance to a buffer.
      Returns:
      the buffer
    • size

      public static long size(MemorySegment segment, long index)
      Returns size at the given index.
      Parameters:
      segment - the segment of the struct
      index - the index of the struct buffer
      Returns:
      size at the given index
    • size

      public long size()
      Returns size.
      Returns:
      size
    • size

      public static void size(MemorySegment segment, long index, long value)
      Sets size with the given value at the given index.
      Parameters:
      segment - the segment of the struct
      index - the index of the struct buffer
      value - the value
    • size

      public VkMemoryRequirements size(long value)
      Sets size with the given value.
      Parameters:
      value - the value
      Returns:
      this
    • alignment

      public static long alignment(MemorySegment segment, long index)
      Returns alignment at the given index.
      Parameters:
      segment - the segment of the struct
      index - the index of the struct buffer
      Returns:
      alignment at the given index
    • alignment

      public long alignment()
      Returns alignment.
      Returns:
      alignment
    • alignment

      public static void alignment(MemorySegment segment, long index, long value)
      Sets alignment with the given value at the given index.
      Parameters:
      segment - the segment of the struct
      index - the index of the struct buffer
      value - the value
    • alignment

      public VkMemoryRequirements alignment(long value)
      Sets alignment with the given value.
      Parameters:
      value - the value
      Returns:
      this
    • memoryTypeBits

      public static int memoryTypeBits(MemorySegment segment, long index)
      Returns memoryTypeBits at the given index.
      Parameters:
      segment - the segment of the struct
      index - the index of the struct buffer
      Returns:
      memoryTypeBits at the given index
    • memoryTypeBits

      public int memoryTypeBits()
      Returns memoryTypeBits.
      Returns:
      memoryTypeBits
    • memoryTypeBits

      public static void memoryTypeBits(MemorySegment segment, long index, int value)
      Sets memoryTypeBits with the given value at the given index.
      Parameters:
      segment - the segment of the struct
      index - the index of the struct buffer
      value - the value
    • memoryTypeBits

      public VkMemoryRequirements memoryTypeBits(int value)
      Sets memoryTypeBits with the given value.
      Parameters:
      value - the value
      Returns:
      this