Class VkSparseMemoryBind

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

    public class VkSparseMemoryBind
    extends Struct
    implements NativeResource
    Structure specifying a sparse memory bind operation.
    Description

    The binding range [resourceOffset, resourceOffset + size) has different constraints based on flags. If flags contains SPARSE_MEMORY_BIND_METADATA_BIT, the binding range must be within the mip tail region of the metadata aspect. This metadata region is defined by:

    metadataRegion = [base, base + imageMipTailSize)
    base = imageMipTailOffset + imageMipTailStride × n

    and imageMipTailOffset, imageMipTailSize, and imageMipTailStride values are from the VkSparseImageMemoryRequirements corresponding to the metadata aspect of the image, and n is a valid array layer index for the image,

    imageMipTailStride is considered to be zero for aspects where VkSparseImageMemoryRequirements::formatProperties.flags contains SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT.

    If flags does not contain SPARSE_MEMORY_BIND_METADATA_BIT, the binding range must be within the range [0,VkMemoryRequirements::size).

    Valid Usage
    Valid Usage (Implicit)
    • If memory is not NULL_HANDLE, memory must be a valid VkDeviceMemory handle
    • flags must be a valid combination of VkSparseMemoryBindFlagBits values
    See Also

    VkSparseBufferMemoryBindInfo, VkSparseImageOpaqueMemoryBindInfo

    Member documentation

    • resourceOffset – the offset into the resource.
    • size – the size of the memory region to be bound.
    • memory – the VkDeviceMemory object that the range of the resource is bound to. If memory is NULL_HANDLE, the range is unbound.
    • memoryOffset – the offset into the VkDeviceMemory object to bind the resource range to. If memory is NULL_HANDLE, this value is ignored.
    • flags – a bitmask of VkSparseMemoryBindFlagBits specifying usage of the binding operation.

    Layout

    
     struct VkSparseMemoryBind {
         VkDeviceSize resourceOffset;
         VkDeviceSize size;
         VkDeviceMemory memory;
         VkDeviceSize memoryOffset;
         VkSparseMemoryBindFlags flags;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • RESOURCEOFFSET, SIZE, MEMORY, MEMORYOFFSET, FLAGS

        The struct member offsets.
    • Constructor Detail

      • VkSparseMemoryBind

        public VkSparseMemoryBind​(java.nio.ByteBuffer container)
        Creates a VkSparseMemoryBind 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()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • resourceOffset

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

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

        public long memory()
        Returns the value of the memory field.
      • memoryOffset

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

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

        public VkSparseMemoryBind resourceOffset​(long value)
        Sets the specified value to the resourceOffset field.
      • size

        public VkSparseMemoryBind size​(long value)
        Sets the specified value to the size field.
      • memory

        public VkSparseMemoryBind memory​(long value)
        Sets the specified value to the memory field.
      • memoryOffset

        public VkSparseMemoryBind memoryOffset​(long value)
        Sets the specified value to the memoryOffset field.
      • flags

        public VkSparseMemoryBind flags​(int value)
        Sets the specified value to the flags field.
      • set

        public VkSparseMemoryBind set​(long resourceOffset,
                                      long size,
                                      long memory,
                                      long memoryOffset,
                                      int flags)
        Initializes this struct with the specified values.
      • malloc

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

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

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

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

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

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

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

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

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

        public static long nresourceOffset​(long struct)
        Unsafe version of resourceOffset().
      • nsize

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

        public static long nmemory​(long struct)
        Unsafe version of memory().
      • nmemoryOffset

        public static long nmemoryOffset​(long struct)
        Unsafe version of memoryOffset().
      • nflags

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

        public static void nresourceOffset​(long struct,
                                           long value)
        Unsafe version of resourceOffset.
      • nsize

        public static void nsize​(long struct,
                                 long value)
        Unsafe version of size.
      • nmemory

        public static void nmemory​(long struct,
                                   long value)
        Unsafe version of memory.
      • nmemoryOffset

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

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