Class VkBindImageMemoryDeviceGroupInfo

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

    public class VkBindImageMemoryDeviceGroupInfo
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Structure specifying device within a group to bind to.
    Description

    The VkBindImageMemoryDeviceGroupInfo structure is defined as:

    • sType is the type of this structure.
    • pNext is NULL or a pointer to an extension-specific structure.
    • deviceIndexCount is the number of elements in pDeviceIndices.
    • pDeviceIndices is a pointer to an array of device indices.
    • splitInstanceBindRegionCount is the number of elements in pSplitInstanceBindRegions.
    • pSplitInstanceBindRegions is a pointer to an array of rectangles describing which regions of the image are attached to each instance of memory.

    If deviceIndexCount is greater than zero, then on device index i image is attached to the instance of the memory on the physical device with device index pDeviceIndices[i].

    Let N be the number of physical devices in the logical device. If splitInstanceBindRegionCount is greater than zero, then pSplitInstanceBindRegions is an array of N2 rectangles, where the image region specified by the rectangle at element i*N+j in resource instance i is bound to the memory instance j. The blocks of the memory that are bound to each sparse image block region use an offset in memory, relative to memoryOffset, computed as if the whole image were being bound to a contiguous range of memory. In other words, horizontally adjacent image blocks use consecutive blocks of memory, vertically adjacent image blocks are separated by the number of bytes per block multiplied by the width in blocks of image, and the block at (0,0) corresponds to memory starting at memoryOffset.

    If splitInstanceBindRegionCount and deviceIndexCount are zero and the memory comes from a memory heap with the MEMORY_HEAP_MULTI_INSTANCE_BIT bit set, then it is as if pDeviceIndices contains consecutive indices from zero to the number of physical devices in the logical device, minus one. In other words, by default each physical device attaches to its own instance of the memory.

    If splitInstanceBindRegionCount and deviceIndexCount are zero and the memory comes from a memory heap without the MEMORY_HEAP_MULTI_INSTANCE_BIT bit set, then it is as if pDeviceIndices contains an array of zeros. In other words, by default each physical device attaches to instance zero.

    Valid Usage
    • At least one of deviceIndexCount and splitInstanceBindRegionCount must be zero.
    • deviceIndexCount must either be zero or equal to the number of physical devices in the logical device
    • All elements of pDeviceIndices must be valid device indices.
    • splitInstanceBindRegionCount must either be zero or equal to the number of physical devices in the logical device squared
    • Elements of pSplitInstanceBindRegions that correspond to the same instance of an image must not overlap.
    • The offset.x member of any element of pSplitInstanceBindRegions must be a multiple of the sparse image block width (VkSparseImageFormatProperties::imageGranularity.width) of all non-metadata aspects of the image
    • The offset.y member of any element of pSplitInstanceBindRegions must be a multiple of the sparse image block height (VkSparseImageFormatProperties::imageGranularity.height) of all non-metadata aspects of the image
    • The extent.width member of any element of pSplitInstanceBindRegions must either be a multiple of the sparse image block width of all non-metadata aspects of the image, or else extent.width + offset.x must equal the width of the image subresource
    • The extent.height member of any element of pSplitInstanceBindRegions must either be a multiple of the sparse image block height of all non-metadata aspects of the image, or else extent.height offset.y must equal the width of the image subresource
    Valid Usage (Implicit)
    • sType must be STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO
    • If deviceIndexCount is not 0, pDeviceIndices must be a valid pointer to an array of deviceIndexCount uint32_t values
    • If splitInstanceBindRegionCount is not 0, pSplitInstanceBindRegions must be a valid pointer to an array of splitInstanceBindRegionCount VkRect2D structures
    See Also

    VkRect2D

    Layout

    
     struct VkBindImageMemoryDeviceGroupInfo {
         VkStructureType sType;
         void const * pNext;
         uint32_t deviceIndexCount;
         uint32_t const * pDeviceIndices;
         uint32_t splitInstanceBindRegionCount;
         VkRect2D const * pSplitInstanceBindRegions;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • STYPE, PNEXT, DEVICEINDEXCOUNT, PDEVICEINDICES, SPLITINSTANCEBINDREGIONCOUNT, PSPLITINSTANCEBINDREGIONS

        The struct member offsets.
    • Constructor Detail

      • VkBindImageMemoryDeviceGroupInfo

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

        public int deviceIndexCount()
        Returns the value of the deviceIndexCount field.
      • pDeviceIndices

        @Nullable
        public java.nio.IntBuffer pDeviceIndices()
        Returns a IntBuffer view of the data pointed to by the pDeviceIndices field.
      • splitInstanceBindRegionCount

        public int splitInstanceBindRegionCount()
        Returns the value of the splitInstanceBindRegionCount field.
      • pSplitInstanceBindRegions

        @Nullable
        public VkRect2D.Buffer pSplitInstanceBindRegions()
        Returns a VkRect2D.Buffer view of the struct array pointed to by the pSplitInstanceBindRegions field.
      • pDeviceIndices

        public VkBindImageMemoryDeviceGroupInfo pDeviceIndices​(@Nullable
                                                               java.nio.IntBuffer value)
        Sets the address of the specified IntBuffer to the pDeviceIndices field.
      • malloc

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

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

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

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

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

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

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

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

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

        public static int ndeviceIndexCount​(long struct)
        Unsafe version of deviceIndexCount().
      • npDeviceIndices

        @Nullable
        public static java.nio.IntBuffer npDeviceIndices​(long struct)
        Unsafe version of pDeviceIndices.
      • 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.
      • ndeviceIndexCount

        public static void ndeviceIndexCount​(long struct,
                                             int value)
        Sets the specified value to the deviceIndexCount field of the specified struct.
      • npDeviceIndices

        public static void npDeviceIndices​(long struct,
                                           @Nullable
                                           java.nio.IntBuffer value)
        Unsafe version of pDeviceIndices.
      • nsplitInstanceBindRegionCount

        public static void nsplitInstanceBindRegionCount​(long struct,
                                                         int value)
        Sets the specified value to the splitInstanceBindRegionCount field of the specified struct.
      • validate

        public static void validate​(long struct)
        Validates pointer members that should not be NULL.
        Parameters:
        struct - the struct to validate
      • validate

        public static void validate​(long array,
                                    int count)
        Calls validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array