Class VkMemoryAllocateFlagsInfo

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer
    Direct Known Subclasses:
    VkMemoryAllocateFlagsInfoKHR

    public class VkMemoryAllocateFlagsInfo
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Structure controlling how many instances of memory will be allocated.
    Description

    If MEMORY_ALLOCATE_DEVICE_MASK_BIT is not set, the number of instances allocated depends on whether MEMORY_HEAP_MULTI_INSTANCE_BIT is set in the memory heap. If MEMORY_HEAP_MULTI_INSTANCE_BIT is set, then memory is allocated for every physical device in the logical device (as if deviceMask has bits set for all device indices). If MEMORY_HEAP_MULTI_INSTANCE_BIT is not set, then a single instance of memory is allocated (as if deviceMask is set to one).

    On some implementations, allocations from a multi-instance heap may consume memory on all physical devices even if the deviceMask excludes some devices. If VkPhysicalDeviceGroupProperties::subsetAllocation is TRUE, then memory is only consumed for the devices in the device mask.

    Note

    In practice, most allocations on a multi-instance heap will be allocated across all physical devices. Unicast allocation support is an optional optimization for a minority of allocations.

    Valid Usage
    Valid Usage (Implicit)

    Member documentation

    • sType – the type of this structure.
    • pNextNULL or a pointer to an extension-specific structure.
    • flags – a bitmask of VkMemoryAllocateFlagBits controlling the allocation.
    • deviceMask – a mask of physical devices in the logical device, indicating that memory must be allocated on each device in the mask, if MEMORY_ALLOCATE_DEVICE_MASK_BIT is set in flags.

    Layout

    
     struct VkMemoryAllocateFlagsInfo {
         VkStructureType sType;
         void const * pNext;
         VkMemoryAllocateFlags flags;
         uint32_t deviceMask;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • STYPE, PNEXT, FLAGS, DEVICEMASK

        The struct member offsets.
    • Constructor Detail

      • VkMemoryAllocateFlagsInfo

        public VkMemoryAllocateFlagsInfo​(java.nio.ByteBuffer container)
        Creates a VkMemoryAllocateFlagsInfo 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
      • sType

        public int sType()
        Returns the value of the sType field.
      • pNext

        public long pNext()
        Returns the value of the pNext field.
      • flags

        public int flags()
        Returns the value of the flags field.
      • deviceMask

        public int deviceMask()
        Returns the value of the deviceMask field.
      • set

        public VkMemoryAllocateFlagsInfo set​(int sType,
                                             long pNext,
                                             int flags,
                                             int deviceMask)
        Initializes this struct with the specified values.
      • malloc

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

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

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

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

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

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

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

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

        public static VkMemoryAllocateFlagsInfo.Buffer callocStack​(int capacity,
                                                                   org.lwjgl.system.MemoryStack stack)
        Returns a new VkMemoryAllocateFlagsInfo.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
      • nsType

        public static int nsType​(long struct)
        Unsafe version of sType().
      • npNext

        public static long npNext​(long struct)
        Unsafe version of pNext().
      • nflags

        public static int nflags​(long struct)
        Unsafe version of flags().
      • ndeviceMask

        public static int ndeviceMask​(long struct)
        Unsafe version of deviceMask().
      • nsType

        public static void nsType​(long struct,
                                  int value)
        Unsafe version of sType.
      • npNext

        public static void npNext​(long struct,
                                  long value)
        Unsafe version of pNext.
      • nflags

        public static void nflags​(long struct,
                                  int value)
        Unsafe version of flags.
      • ndeviceMask

        public static void ndeviceMask​(long struct,
                                       int value)
        Unsafe version of deviceMask.