Class VkMemoryRequirements

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

    public class VkMemoryRequirements
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Structure specifying memory requirements.

    Member documentation

    • size – the size, in bytes, of the memory allocation required: for the resource.
    • alignment – the alignment, in bytes, of the offset within the allocation required: for the resource.
    • memoryTypeBits – a bitmask and contains one bit set for every supported memory type for the resource. Bit i is set if and only if the memory type i in the VkPhysicalDeviceMemoryProperties structure for the physical device is supported for the resource.

    Layout

    
     struct VkMemoryRequirements {
         VkDeviceSize size;
         VkDeviceSize alignment;
         uint32_t memoryTypeBits;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • SIZE, ALIGNMENT, MEMORYTYPEBITS

        The struct member offsets.
    • Constructor Detail

      • VkMemoryRequirements

        public VkMemoryRequirements​(java.nio.ByteBuffer container)
        Creates a VkMemoryRequirements instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • size

        public long size()
        Returns the value of the size field.
      • alignment

        public long alignment()
        Returns the value of the alignment field.
      • memoryTypeBits

        public int memoryTypeBits()
        Returns the value of the memoryTypeBits field.
      • malloc

        public static VkMemoryRequirements malloc()
        Returns a new VkMemoryRequirements instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static VkMemoryRequirements calloc()
        Returns a new VkMemoryRequirements instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static VkMemoryRequirements create()
        Returns a new VkMemoryRequirements instance allocated with BufferUtils.
      • create

        public static VkMemoryRequirements create​(long address)
        Returns a new VkMemoryRequirements instance for the specified memory address.
      • createSafe

        @Nullable
        public static VkMemoryRequirements createSafe​(long address)
        Like create, but returns null if address is NULL.
      • mallocStack

        public static VkMemoryRequirements mallocStack()
        Returns a new VkMemoryRequirements instance allocated on the thread-local MemoryStack.
      • callocStack

        public static VkMemoryRequirements callocStack()
        Returns a new VkMemoryRequirements instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static VkMemoryRequirements mallocStack​(org.lwjgl.system.MemoryStack stack)
        Returns a new VkMemoryRequirements instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static VkMemoryRequirements callocStack​(org.lwjgl.system.MemoryStack stack)
        Returns a new VkMemoryRequirements instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • mallocStack

        public static VkMemoryRequirements.Buffer mallocStack​(int capacity,
                                                              org.lwjgl.system.MemoryStack stack)
        Returns a new VkMemoryRequirements.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • callocStack

        public static VkMemoryRequirements.Buffer callocStack​(int capacity,
                                                              org.lwjgl.system.MemoryStack stack)
        Returns a new VkMemoryRequirements.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nsize

        public static long nsize​(long struct)
        Unsafe version of size().
      • nalignment

        public static long nalignment​(long struct)
        Unsafe version of alignment().
      • nmemoryTypeBits

        public static int nmemoryTypeBits​(long struct)
        Unsafe version of memoryTypeBits().